@ourofoundation/ouro-js 3.5.1 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XQQVHVWP.js → chunk-35CJDNHH.js} +2 -2
- package/dist/{chunk-XQQVHVWP.js.map → chunk-35CJDNHH.js.map} +1 -1
- package/dist/{chunk-6XQFD2Z2.cjs → chunk-6GPIZJ4T.cjs} +2 -2
- package/dist/chunk-6GPIZJ4T.cjs.map +1 -0
- package/dist/{chunk-HN7Y7VMJ.cjs → chunk-6ZJQTECB.cjs} +2 -2
- package/dist/{chunk-HN7Y7VMJ.cjs.map → chunk-6ZJQTECB.cjs.map} +1 -1
- package/dist/{chunk-6FG474SV.cjs → chunk-BWAEBQKV.cjs} +2 -2
- package/dist/chunk-BWAEBQKV.cjs.map +1 -0
- package/dist/{chunk-DC6TYS3A.cjs → chunk-F5CWCYOP.cjs} +2 -2
- package/dist/chunk-F5CWCYOP.cjs.map +1 -0
- package/dist/{chunk-NJQ5YWYJ.cjs → chunk-HIXNQKVP.cjs} +2 -2
- package/dist/{chunk-NJQ5YWYJ.cjs.map → chunk-HIXNQKVP.cjs.map} +1 -1
- package/dist/{chunk-OS542EYD.js → chunk-IWOXGKK4.js} +2 -2
- package/dist/chunk-IWOXGKK4.js.map +1 -0
- package/dist/chunk-KCVE35IO.js +2 -0
- package/dist/chunk-KCVE35IO.js.map +1 -0
- package/dist/chunk-MLTO7TMM.js +2 -0
- package/dist/chunk-MLTO7TMM.js.map +1 -0
- package/dist/{chunk-EK5P7FST.js → chunk-R2W4NEEJ.js} +2 -2
- package/dist/chunk-R2W4NEEJ.js.map +1 -0
- package/dist/{chunk-M2JJPDBW.js → chunk-TYOQ32UV.js} +2 -2
- package/dist/{chunk-M2JJPDBW.js.map → chunk-TYOQ32UV.js.map} +1 -1
- package/dist/chunk-V73EW77Y.cjs +2 -0
- package/dist/chunk-V73EW77Y.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/schema/assets.d.cts +84 -84
- package/dist/schema/assets.d.ts +84 -84
- package/dist/schema/comments.d.cts +136 -136
- package/dist/schema/comments.d.ts +136 -136
- package/dist/schema/common.d.cts +16 -16
- package/dist/schema/common.d.ts +16 -16
- package/dist/schema/conversations.cjs +1 -1
- package/dist/schema/conversations.d.cts +69 -69
- package/dist/schema/conversations.d.ts +69 -69
- package/dist/schema/conversations.js +1 -1
- package/dist/schema/datasets.d.cts +137 -137
- package/dist/schema/datasets.d.ts +137 -137
- package/dist/schema/files.cjs +1 -1
- package/dist/schema/files.d.cts +100 -103
- package/dist/schema/files.d.ts +100 -103
- package/dist/schema/files.js +1 -1
- package/dist/schema/notifications.d.cts +2 -2
- package/dist/schema/notifications.d.ts +2 -2
- package/dist/schema/organizations.d.cts +1 -1
- package/dist/schema/organizations.d.ts +1 -1
- package/dist/schema/posts.cjs +1 -1
- package/dist/schema/posts.d.cts +127 -130
- package/dist/schema/posts.d.ts +127 -130
- package/dist/schema/posts.js +1 -1
- package/dist/schema/quests.cjs +1 -1
- package/dist/schema/quests.d.cts +177 -180
- package/dist/schema/quests.d.ts +177 -180
- package/dist/schema/quests.js +1 -1
- package/dist/schema/services.cjs +1 -1
- package/dist/schema/services.d.cts +127 -130
- package/dist/schema/services.d.ts +127 -130
- package/dist/schema/services.js +1 -1
- package/dist/schema/teams.d.cts +18 -18
- package/dist/schema/teams.d.ts +18 -18
- package/dist/utils/quest-submission.cjs +1 -1
- package/dist/utils/quest-submission.d.cts +7 -7
- package/dist/utils/quest-submission.d.ts +7 -7
- package/dist/utils/quest-submission.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6FG474SV.cjs.map +0 -1
- package/dist/chunk-6XQFD2Z2.cjs.map +0 -1
- package/dist/chunk-DC6TYS3A.cjs.map +0 -1
- package/dist/chunk-EK5P7FST.js.map +0 -1
- package/dist/chunk-OFDJA6ZW.cjs +0 -2
- package/dist/chunk-OFDJA6ZW.cjs.map +0 -1
- package/dist/chunk-OS542EYD.js.map +0 -1
- package/dist/chunk-VJJLRHOX.js +0 -2
- package/dist/chunk-VJJLRHOX.js.map +0 -1
- package/dist/chunk-W5UCZ73B.js +0 -2
- package/dist/chunk-W5UCZ73B.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/quest-submission.ts"],"names":["isPlainObject","value","normalizeFileExtension","safe","normalizeFileExtensions","rawValues","entry","KeyedAssetRefsSchema","record","string","object","uuid","AssetTypeSchema","KeyedAssetInputValueSchema","union","optional","KeyedAssetInputSchema","QuestSubmissionAssetDeclarationSchema","RouteInputAssetDeclarationSchema","boolean","readDeclarationExtensions","declaration","readDeclarationFilter","getRouteInputDeclarationsFromRoute","route","_a","detail","inputs","entries","declarationToSubmissionDeclaration","extensions","filter","materializeContributorSubmissionAssets","routeInputs","pinnedKeys","pinned","out","key","getPrimaryDeclarationKey","declarations","primary","d","getSubmissionAssetShape","item","_b","materialized","declarationToPickerFilters","assetType","filters","fileType","assetMatchesDeclaration","asset","_c","_d","_e","_f","metadata","ext","type","expected","getPrimaryAssetRef","refs","ref","toRouteInputAssets"],"mappings":"2IAeA,SAASA,EAAcC,CAAkD,CAAA,CACvE,OAAO,CAAQA,CAAAA,CAAAA,EAAU,OAAOA,CAAU,EAAA,QAAA,EAAY,CAAC,KAAM,CAAA,OAAA,CAAQA,CAAK,CAC5E,CAEA,SAASC,CAAuBD,CAAAA,CAAAA,CAAiD,CAC/E,GAAI,CAACA,EAAO,OAAO,IAAA,CAEnB,IAAME,CADaF,CAAAA,CAAAA,CAAM,QAAQ,MAAQ,CAAA,EAAE,EAAE,IAAK,EAAA,CAAE,aAC5B,CAAA,OAAA,CAAQ,aAAc,EAAE,CAAA,CAChD,OAAI,CAACE,CAAAA,EAAQ,QAAQ,IAAKA,CAAAA,CAAI,GAAKA,CAAK,CAAA,MAAA,CAAS,GAAW,IACrDA,CAAAA,CACT,CAEA,SAASC,CAAAA,CAC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AAW,EADhD,IAEnB,CAEO,SAASC,CACdF,CAAAA,CAAAA,CACwD,CACxD,OAAKA,CAAAA,CACE,OAAO,WACZ,CAAA,MAAA,CAAO,QAAQA,CAAI,CAAA,CAAE,IAAI,CAAC,CAACxB,EAAKyB,CAAG,CAAA,GAAM,CACvCzB,CACA,CAAA,CAAE,QAASyB,CAAI,CAAA,QAAA,CAAU,UAAWA,CAAI,CAAA,UAAW,CACrD,CAAC,CACH,CANkB,CAAA,EAOpB","file":"chunk-M2JJPDBW.js","sourcesContent":["import {\n object,\n string,\n record,\n optional,\n boolean,\n array,\n uuid,\n union,\n type z,\n} from \"zod\";\n\nimport { AssetTypeSchema } from \"../schema/common\";\nimport { RouteInputAssetDeclarationSchema } from \"../schema/services\";\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction normalizeFileExtension(value: string | null | undefined): string | null {\n if (!value) return null;\n const normalized = value.replace(/^\\.+/, \"\").trim().toLowerCase();\n const safe = normalized.replace(/[^a-z0-9]/g, \"\");\n if (!safe || /^\\d+$/.test(safe) || safe.length > 12) return null;\n return safe;\n}\n\nfunction normalizeFileExtensions(\n value: string | string[] | null | undefined\n): string[] {\n const rawValues = Array.isArray(value)\n ? value\n : typeof value === \"string\"\n ? value.split(/[\\s,]+/)\n : [];\n return Array.from(\n new Set(\n rawValues\n .map((entry) => normalizeFileExtension(entry))\n .filter((entry): entry is string => Boolean(entry))\n )\n );\n}\n\n/** Stored on entries and eval_static_inputs after server normalization. */\nexport const KeyedAssetRefsSchema = record(\n string(),\n object({\n asset_id: uuid(),\n asset_type: AssetTypeSchema,\n })\n);\n\n/** Accepted on POST /quests/:id/entries/create — server fills asset_type. */\nexport const KeyedAssetInputValueSchema = union([\n uuid(),\n object({\n asset_id: uuid(),\n asset_type: optional(AssetTypeSchema),\n }),\n]);\n\nexport const KeyedAssetInputSchema = record(\n string(),\n KeyedAssetInputValueSchema\n);\n\nexport const QuestSubmissionAssetDeclarationSchema =\n RouteInputAssetDeclarationSchema.extend({\n required: optional(boolean()).default(true),\n });\n\nexport type KeyedAssetRefs = z.infer<typeof KeyedAssetRefsSchema>;\nexport type KeyedAssetInput = z.infer<typeof KeyedAssetInputSchema>;\nexport type QuestSubmissionAssetDeclaration = z.infer<\n typeof QuestSubmissionAssetDeclarationSchema\n>;\n\nexport type AssetDeclarationPickerFilters = {\n assetType?: string;\n fileType?: string;\n extensions?: string[];\n hasConstraints: boolean;\n};\n\nexport type QuestSubmissionItemInput = {\n eval_route_id?: string | null;\n submission_assets?: Record<string, QuestSubmissionAssetDeclaration> | null;\n eval_static_inputs?: KeyedAssetRefs | null;\n expected_asset_type?: string | null;\n};\n\nexport type RouteInputDeclarationLike = {\n asset_type?: string | null;\n primary?: boolean;\n input_filter?: string | null;\n filter?: string | null;\n file_extensions?: string[] | null;\n input_file_extensions?: string[] | null;\n};\n\nexport type RouteForSubmissionShape = {\n route?: {\n input_assets?: Record<string, RouteInputDeclarationLike> | null;\n input_type?: string | null;\n input_filter?: string | null;\n input_file_extensions?: string[] | null;\n } | null;\n} | null;\n\nfunction readDeclarationExtensions(\n declaration: RouteInputDeclarationLike\n): string[] {\n return normalizeFileExtensions([\n ...(Array.isArray(declaration.file_extensions)\n ? declaration.file_extensions\n : []),\n ...(Array.isArray(declaration.input_file_extensions)\n ? declaration.input_file_extensions\n : []),\n ].join(\",\"));\n}\n\nfunction readDeclarationFilter(\n declaration: RouteInputDeclarationLike\n): string | undefined {\n return declaration.input_filter || declaration.filter || undefined;\n}\n\n/** Route keyed inputs as a flat map (includes legacy input_type fallback). */\nexport function getRouteInputDeclarationsFromRoute(\n route: RouteForSubmissionShape\n): Record<string, RouteInputDeclarationLike> {\n const detail = route?.route;\n if (!detail) return {};\n\n const inputs = detail.input_assets;\n if (isPlainObject(inputs)) {\n const entries = Object.entries(inputs).filter(([, value]) =>\n isPlainObject(value)\n ) as [string, RouteInputDeclarationLike][];\n if (entries.length > 0) {\n return Object.fromEntries(entries);\n }\n }\n\n if (detail.input_type) {\n return {\n [detail.input_type]: {\n asset_type: detail.input_type,\n primary: true,\n input_filter: detail.input_filter,\n input_file_extensions: detail.input_file_extensions ?? null,\n },\n };\n }\n\n return {};\n}\n\nexport function declarationToSubmissionDeclaration(\n declaration: RouteInputDeclarationLike\n): QuestSubmissionAssetDeclaration {\n const extensions = readDeclarationExtensions(declaration);\n const filter = readDeclarationFilter(declaration);\n return {\n asset_type: declaration.asset_type as QuestSubmissionAssetDeclaration[\"asset_type\"],\n primary: declaration.primary,\n input_filter: (filter ?? null) as QuestSubmissionAssetDeclaration[\"input_filter\"],\n file_extensions: extensions.length > 0 ? extensions : null,\n required: true,\n };\n}\n\n/** Materialize contributor declarations from route inputs minus pinned keys. */\nexport function materializeContributorSubmissionAssets(\n routeInputs: Record<string, RouteInputDeclarationLike>,\n pinnedKeys: string[]\n): Record<string, QuestSubmissionAssetDeclaration> {\n const pinned = new Set(pinnedKeys);\n const out: Record<string, QuestSubmissionAssetDeclaration> = {};\n for (const [key, declaration] of Object.entries(routeInputs)) {\n if (pinned.has(key)) continue;\n out[key] = declarationToSubmissionDeclaration(declaration);\n }\n return out;\n}\n\nexport function getPrimaryDeclarationKey(\n declarations: Record<string, QuestSubmissionAssetDeclaration>\n): string | null {\n const entries = Object.entries(declarations);\n if (!entries.length) return null;\n const primary = entries.find(([, d]) => d.primary === true);\n if (primary) return primary[0];\n if (entries.length === 1) return entries[0][0];\n return entries[0][0];\n}\n\nexport function getSubmissionAssetShape(\n item: QuestSubmissionItemInput,\n route?: RouteForSubmissionShape | null\n): {\n contributorKeys: string[];\n declarations: Record<string, QuestSubmissionAssetDeclaration>;\n pinned: KeyedAssetRefs;\n} {\n const pinned: KeyedAssetRefs = item.eval_static_inputs ?? {};\n\n if (item.eval_route_id && route) {\n const routeInputs = getRouteInputDeclarationsFromRoute(route);\n const pinnedKeys = Object.keys(pinned);\n const materialized =\n item.submission_assets &&\n Object.keys(item.submission_assets).length > 0\n ? item.submission_assets\n : materializeContributorSubmissionAssets(routeInputs, pinnedKeys);\n const contributorKeys = Object.keys(materialized);\n return {\n contributorKeys,\n declarations: materialized,\n pinned,\n };\n }\n\n const declarations = item.submission_assets ?? {};\n return {\n contributorKeys: Object.keys(declarations),\n declarations,\n pinned,\n };\n}\n\nexport function declarationToPickerFilters(\n declaration: RouteInputDeclarationLike | QuestSubmissionAssetDeclaration | null | undefined\n): AssetDeclarationPickerFilters | null {\n if (!declaration) return null;\n const assetType = declaration.asset_type || undefined;\n if (!assetType) return null;\n\n const filters: AssetDeclarationPickerFilters = {\n assetType,\n hasConstraints: false,\n };\n\n if (assetType === \"file\") {\n const extensions = readDeclarationExtensions(declaration);\n if (extensions.length > 0) {\n filters.extensions = extensions;\n filters.hasConstraints = true;\n }\n const fileType = readDeclarationFilter(declaration);\n if (fileType) {\n filters.fileType = fileType;\n filters.hasConstraints = true;\n }\n }\n\n return filters;\n}\n\nexport function assetMatchesDeclaration(\n asset:\n | {\n assetType?: string | null;\n asset_type?: string | null;\n asset?: { metadata?: Record<string, unknown> } | null;\n }\n | null\n | undefined,\n declaration: RouteInputDeclarationLike | QuestSubmissionAssetDeclaration | null | undefined\n): boolean {\n if (!declaration || !asset) return true;\n const filters = declarationToPickerFilters(declaration);\n if (!filters) return true;\n\n const assetType = asset.assetType ?? asset.asset_type;\n if (filters.assetType && assetType !== filters.assetType) return false;\n\n if (filters.assetType === \"file\") {\n const metadata = asset.asset?.metadata ?? {};\n if (filters.extensions && filters.extensions.length > 0) {\n const ext = String(metadata.extension ?? \"\").toLowerCase();\n if (!ext || !filters.extensions.includes(ext)) return false;\n }\n if (filters.fileType) {\n const type = String(metadata.file_type ?? metadata.type ?? \"\")\n .toLowerCase()\n .split(\"/\")[0];\n const expected = filters.fileType.toLowerCase();\n if (type && expected && !type.includes(expected) && type !== expected) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nexport function getPrimaryAssetRef(\n refs: KeyedAssetRefs | null | undefined,\n declarations?: Record<string, QuestSubmissionAssetDeclaration> | null\n): { key: string; asset_id: string; asset_type: string } | null {\n if (!refs || !Object.keys(refs).length) return null;\n const key =\n (declarations && getPrimaryDeclarationKey(declarations)) ||\n Object.keys(refs)[0];\n const ref = refs[key];\n if (!ref) return null;\n return { key, asset_id: ref.asset_id, asset_type: ref.asset_type };\n}\n\nexport function toRouteInputAssets(\n refs: KeyedAssetRefs | null | undefined\n): Record<string, { assetId: string; assetType: string }> {\n if (!refs) return {};\n return Object.fromEntries(\n Object.entries(refs).map(([key, ref]) => [\n key,\n { assetId: ref.asset_id, assetType: ref.asset_type },\n ])\n );\n}\n\n/** @deprecated Use declarationToPickerFilters */\nexport type EvalSubmissionFilters = AssetDeclarationPickerFilters;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/quest-submission.ts"],"names":["isPlainObject","value","normalizeFileExtension","safe","normalizeFileExtensions","rawValues","entry","KeyedAssetRefsSchema","record","string","object","uuid","AssetTypeSchema","KeyedAssetInputValueSchema","union","optional","KeyedAssetInputSchema","QuestSubmissionAssetDeclarationSchema","RouteInputAssetDeclarationSchema","boolean","readDeclarationExtensions","declaration","readDeclarationFilter","getRouteInputDeclarationsFromRoute","route","_a","detail","inputs","entries","declarationToSubmissionDeclaration","extensions","filter","materializeContributorSubmissionAssets","routeInputs","pinnedKeys","pinned","out","key","getPrimaryDeclarationKey","declarations","primary","d","getSubmissionAssetShape","item","_b","materialized","declarationToPickerFilters","assetType","filters","fileType","assetMatchesDeclaration","asset","_c","_d","_e","_f","metadata","ext","type","expected","getPrimaryAssetRef","refs","ref","toRouteInputAssets"],"mappings":"2IAeA,SAASA,EAAcC,CAAkD,CAAA,CACvE,OAAO,CAAQA,CAAAA,CAAAA,EAAU,OAAOA,CAAU,EAAA,QAAA,EAAY,CAAC,KAAM,CAAA,OAAA,CAAQA,CAAK,CAC5E,CAEA,SAASC,CAAuBD,CAAAA,CAAAA,CAAiD,CAC/E,GAAI,CAACA,EAAO,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OAAQ,OAAO,IAAA,CAC/C,IAAMxB,CACHE,CAAAA,CAAAA,EAAgBD,EAAyBC,CAAY,CAAA,EACtD,OAAO,IAAKsB,CAAAA,CAAI,EAAE,CAAC,CAAA,CACfC,EAAMD,CAAKxB,CAAAA,CAAG,EACpB,OAAKyB,CAAAA,CACE,CAAE,GAAAzB,CAAAA,CAAAA,CAAK,SAAUyB,CAAI,CAAA,QAAA,CAAU,WAAYA,CAAI,CAAA,UAAW,EADhD,IAEnB,CAEO,SAASC,CACdF,CAAAA,CAAAA,CACwD,CACxD,OAAKA,CAAAA,CACE,OAAO,WACZ,CAAA,MAAA,CAAO,QAAQA,CAAI,CAAA,CAAE,IAAI,CAAC,CAACxB,EAAKyB,CAAG,CAAA,GAAM,CACvCzB,CACA,CAAA,CAAE,QAASyB,CAAI,CAAA,QAAA,CAAU,UAAWA,CAAI,CAAA,UAAW,CACrD,CAAC,CACH,CANkB,CAAA,EAOpB","file":"chunk-TYOQ32UV.js","sourcesContent":["import {\n object,\n string,\n record,\n optional,\n boolean,\n array,\n uuid,\n union,\n type z,\n} from \"zod\";\n\nimport { AssetTypeSchema } from \"../schema/common\";\nimport { RouteInputAssetDeclarationSchema } from \"../schema/services\";\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction normalizeFileExtension(value: string | null | undefined): string | null {\n if (!value) return null;\n const normalized = value.replace(/^\\.+/, \"\").trim().toLowerCase();\n const safe = normalized.replace(/[^a-z0-9]/g, \"\");\n if (!safe || /^\\d+$/.test(safe) || safe.length > 12) return null;\n return safe;\n}\n\nfunction normalizeFileExtensions(\n value: string | string[] | null | undefined\n): string[] {\n const rawValues = Array.isArray(value)\n ? value\n : typeof value === \"string\"\n ? value.split(/[\\s,]+/)\n : [];\n return Array.from(\n new Set(\n rawValues\n .map((entry) => normalizeFileExtension(entry))\n .filter((entry): entry is string => Boolean(entry))\n )\n );\n}\n\n/** Stored on entries and eval_static_inputs after server normalization. */\nexport const KeyedAssetRefsSchema = record(\n string(),\n object({\n asset_id: uuid(),\n asset_type: AssetTypeSchema,\n })\n);\n\n/** Accepted on POST /quests/:id/entries/create — server fills asset_type. */\nexport const KeyedAssetInputValueSchema = union([\n uuid(),\n object({\n asset_id: uuid(),\n asset_type: optional(AssetTypeSchema),\n }),\n]);\n\nexport const KeyedAssetInputSchema = record(\n string(),\n KeyedAssetInputValueSchema\n);\n\nexport const QuestSubmissionAssetDeclarationSchema =\n RouteInputAssetDeclarationSchema.extend({\n required: optional(boolean()).default(true),\n });\n\nexport type KeyedAssetRefs = z.infer<typeof KeyedAssetRefsSchema>;\nexport type KeyedAssetInput = z.infer<typeof KeyedAssetInputSchema>;\nexport type QuestSubmissionAssetDeclaration = z.infer<\n typeof QuestSubmissionAssetDeclarationSchema\n>;\n\nexport type AssetDeclarationPickerFilters = {\n assetType?: string;\n fileType?: string;\n extensions?: string[];\n hasConstraints: boolean;\n};\n\nexport type QuestSubmissionItemInput = {\n eval_route_id?: string | null;\n submission_assets?: Record<string, QuestSubmissionAssetDeclaration> | null;\n eval_static_inputs?: KeyedAssetRefs | null;\n expected_asset_type?: string | null;\n};\n\nexport type RouteInputDeclarationLike = {\n asset_type?: string | null;\n primary?: boolean;\n input_filter?: string | null;\n filter?: string | null;\n file_extensions?: string[] | null;\n input_file_extensions?: string[] | null;\n};\n\nexport type RouteForSubmissionShape = {\n route?: {\n input_assets?: Record<string, RouteInputDeclarationLike> | null;\n input_type?: string | null;\n input_filter?: string | null;\n input_file_extensions?: string[] | null;\n } | null;\n} | null;\n\nfunction readDeclarationExtensions(\n declaration: RouteInputDeclarationLike\n): string[] {\n return normalizeFileExtensions([\n ...(Array.isArray(declaration.file_extensions)\n ? declaration.file_extensions\n : []),\n ...(Array.isArray(declaration.input_file_extensions)\n ? declaration.input_file_extensions\n : []),\n ].join(\",\"));\n}\n\nfunction readDeclarationFilter(\n declaration: RouteInputDeclarationLike\n): string | undefined {\n return declaration.input_filter || declaration.filter || undefined;\n}\n\n/** Route keyed inputs as a flat map (includes legacy input_type fallback). */\nexport function getRouteInputDeclarationsFromRoute(\n route: RouteForSubmissionShape\n): Record<string, RouteInputDeclarationLike> {\n const detail = route?.route;\n if (!detail) return {};\n\n const inputs = detail.input_assets;\n if (isPlainObject(inputs)) {\n const entries = Object.entries(inputs).filter(([, value]) =>\n isPlainObject(value)\n ) as [string, RouteInputDeclarationLike][];\n if (entries.length > 0) {\n return Object.fromEntries(entries);\n }\n }\n\n if (detail.input_type) {\n return {\n [detail.input_type]: {\n asset_type: detail.input_type,\n primary: true,\n input_filter: detail.input_filter,\n input_file_extensions: detail.input_file_extensions ?? null,\n },\n };\n }\n\n return {};\n}\n\nexport function declarationToSubmissionDeclaration(\n declaration: RouteInputDeclarationLike\n): QuestSubmissionAssetDeclaration {\n const extensions = readDeclarationExtensions(declaration);\n const filter = readDeclarationFilter(declaration);\n return {\n asset_type: declaration.asset_type as QuestSubmissionAssetDeclaration[\"asset_type\"],\n primary: declaration.primary,\n input_filter: (filter ?? null) as QuestSubmissionAssetDeclaration[\"input_filter\"],\n file_extensions: extensions.length > 0 ? extensions : null,\n required: true,\n };\n}\n\n/** Materialize contributor declarations from route inputs minus pinned keys. */\nexport function materializeContributorSubmissionAssets(\n routeInputs: Record<string, RouteInputDeclarationLike>,\n pinnedKeys: string[]\n): Record<string, QuestSubmissionAssetDeclaration> {\n const pinned = new Set(pinnedKeys);\n const out: Record<string, QuestSubmissionAssetDeclaration> = {};\n for (const [key, declaration] of Object.entries(routeInputs)) {\n if (pinned.has(key)) continue;\n out[key] = declarationToSubmissionDeclaration(declaration);\n }\n return out;\n}\n\nexport function getPrimaryDeclarationKey(\n declarations: Record<string, QuestSubmissionAssetDeclaration>\n): string | null {\n const entries = Object.entries(declarations);\n if (!entries.length) return null;\n const primary = entries.find(([, d]) => d.primary === true);\n if (primary) return primary[0];\n if (entries.length === 1) return entries[0][0];\n return entries[0][0];\n}\n\nexport function getSubmissionAssetShape(\n item: QuestSubmissionItemInput,\n route?: RouteForSubmissionShape | null\n): {\n contributorKeys: string[];\n declarations: Record<string, QuestSubmissionAssetDeclaration>;\n pinned: KeyedAssetRefs;\n} {\n const pinned: KeyedAssetRefs = item.eval_static_inputs ?? {};\n\n if (item.eval_route_id && route) {\n const routeInputs = getRouteInputDeclarationsFromRoute(route);\n const pinnedKeys = Object.keys(pinned);\n const materialized =\n item.submission_assets &&\n Object.keys(item.submission_assets).length > 0\n ? item.submission_assets\n : materializeContributorSubmissionAssets(routeInputs, pinnedKeys);\n const contributorKeys = Object.keys(materialized);\n return {\n contributorKeys,\n declarations: materialized,\n pinned,\n };\n }\n\n const declarations = item.submission_assets ?? {};\n return {\n contributorKeys: Object.keys(declarations),\n declarations,\n pinned,\n };\n}\n\nexport function declarationToPickerFilters(\n declaration: RouteInputDeclarationLike | QuestSubmissionAssetDeclaration | null | undefined\n): AssetDeclarationPickerFilters | null {\n if (!declaration) return null;\n const assetType = declaration.asset_type || undefined;\n if (!assetType) return null;\n\n const filters: AssetDeclarationPickerFilters = {\n assetType,\n hasConstraints: false,\n };\n\n if (assetType === \"file\") {\n const extensions = readDeclarationExtensions(declaration);\n if (extensions.length > 0) {\n filters.extensions = extensions;\n filters.hasConstraints = true;\n }\n const fileType = readDeclarationFilter(declaration);\n if (fileType) {\n filters.fileType = fileType;\n filters.hasConstraints = true;\n }\n }\n\n return filters;\n}\n\nexport function assetMatchesDeclaration(\n asset:\n | {\n assetType?: string | null;\n asset_type?: string | null;\n asset?: { metadata?: Record<string, unknown> } | null;\n }\n | null\n | undefined,\n declaration: RouteInputDeclarationLike | QuestSubmissionAssetDeclaration | null | undefined\n): boolean {\n if (!declaration || !asset) return true;\n const filters = declarationToPickerFilters(declaration);\n if (!filters) return true;\n\n const assetType = asset.assetType ?? asset.asset_type;\n if (filters.assetType && assetType !== filters.assetType) return false;\n\n if (filters.assetType === \"file\") {\n const metadata = asset.asset?.metadata ?? {};\n if (filters.extensions && filters.extensions.length > 0) {\n const ext = String(metadata.extension ?? \"\").toLowerCase();\n if (!ext || !filters.extensions.includes(ext)) return false;\n }\n if (filters.fileType) {\n const type = String(metadata.file_type ?? metadata.type ?? \"\")\n .toLowerCase()\n .split(\"/\")[0];\n const expected = filters.fileType.toLowerCase();\n if (type && expected && !type.includes(expected) && type !== expected) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nexport function getPrimaryAssetRef(\n refs: KeyedAssetRefs | null | undefined,\n declarations?: Record<string, QuestSubmissionAssetDeclaration> | null\n): { key: string; asset_id: string; asset_type: string } | null {\n if (!refs || !Object.keys(refs).length) return null;\n const key =\n (declarations && getPrimaryDeclarationKey(declarations)) ||\n Object.keys(refs)[0];\n const ref = refs[key];\n if (!ref) return null;\n return { key, asset_id: ref.asset_id, asset_type: ref.asset_type };\n}\n\nexport function toRouteInputAssets(\n refs: KeyedAssetRefs | null | undefined\n): Record<string, { assetId: string; assetType: string }> {\n if (!refs) return {};\n return Object.fromEntries(\n Object.entries(refs).map(([key, ref]) => [\n key,\n { assetId: ref.asset_id, assetType: ref.asset_type },\n ])\n );\n}\n\n/** @deprecated Use declarationToPickerFilters */\nexport type EvalSubmissionFilters = AssetDeclarationPickerFilters;\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkROMY5WNQ_cjs=require('./chunk-ROMY5WNQ.cjs'),chunk43KB23BA_cjs=require('./chunk-43KB23BA.cjs'),zod=require('zod');var v=zod.enum(["Personal Access Token","Ouro","None","OAuth 2.0"]),z=zod.object({authentication:v,base_url:zod.string(),version:zod.optional(zod.nullable(zod.string())),spec_path:zod.optional(zod.nullable(zod.string())),spec_url:zod.optional(zod.nullable(zod.string())),auth_url:zod.optional(zod.nullable(zod.string()))}),A=z.extend(chunkROMY5WNQ_cjs.b.partial().shape),D=chunkROMY5WNQ_cjs.c.extend({asset_type:chunk43KB23BA_cjs.a.refine(n=>n==="service"),metadata:A}),C=chunkROMY5WNQ_cjs.d.extend({asset_type:chunk43KB23BA_cjs.a.refine(n=>n==="service"),metadata:A}).transform(n=>chunkROMY5WNQ_cjs.a(n)),w=D.partial().omit({user_id:true,id:true,created_at:true,last_updated:true,organization:true,user:true,team:true,slug:true,is_pinned_in_team:true}).extend({last_updated:zod.string().default(()=>new Date().toISOString())}).transform(n=>chunkROMY5WNQ_cjs.a(n)),x=zod.enum(["sync","async"]),d=zod.enum(["file","dataset","post"]),R=zod.enum(["audio","video","image","pdf","3d model","atomic structure"]),T=zod.object({asset_type:d,primary:zod.optional(zod.boolean()),input_filter:zod.optional(zod.nullable(R)),file_extensions:zod.optional(zod.nullable(zod.array(zod.string()))),contains_file_extensions:zod.optional(zod.nullable(zod.array(zod.string())))}).catchall(zod.any()),O=zod.object({asset_type:d,primary:zod.optional(zod.boolean()),file_extensions:zod.optional(zod.nullable(zod.array(zod.string()))),contains_file_extensions:zod.optional(zod.nullable(zod.array(zod.string())))}).catchall(zod.any()),b=zod.record(zod.string(),T),g=zod.record(zod.string(),O),M=zod.object({id:zod.string(),user_id:zod.string(),service_id:zod.string(),path:zod.string(),method:zod.enum(["GET","POST","PUT","PATCH","DELETE"]),summary:zod.optional(zod.nullable(zod.string())),parameters:zod.optional(zod.nullable(zod.array(zod.record(zod.string(),zod.any())))),request_body:zod.optional(zod.nullable(zod.record(zod.string(),zod.any()))),responses:zod.optional(zod.nullable(zod.array(zod.record(zod.string(),zod.any())))),input_assets:zod.optional(zod.nullable(b)),input_type:zod.optional(zod.nullable(d)),input_filter:zod.optional(zod.nullable(R)),input_file_extension:zod.optional(zod.nullable(zod.string())),input_file_extensions:zod.optional(zod.nullable(zod.array(zod.string()))),output_assets:zod.optional(zod.nullable(g)),output_type:zod.optional(zod.nullable(d)),output_file_extension:zod.optional(zod.nullable(zod.string())),security:zod.optional(zod.nullable(zod.record(zod.string(),zod.any()))),rate_limit:zod.optional(zod.nullable(zod.number())),execution_mode:zod.optional(x).default("sync"),observed_execution_mode:zod.optional(zod.nullable(x)),last_updated:zod.string()}),E=zod.object({avg_ack_ms:zod.optional(zod.nullable(zod.number())),p95_ack_ms:zod.optional(zod.nullable(zod.number())),avg_completion_ms:zod.optional(zod.nullable(zod.number())),p95_completion_ms:zod.optional(zod.nullable(zod.number())),latency_sample_count:zod.optional(zod.nullable(zod.number()))}),F=chunkROMY5WNQ_cjs.c.extend({asset_type:chunk43KB23BA_cjs.a.refine(n=>n==="route"),route:M,metrics:zod.optional(zod.nullable(E))}),U=zod.object({id:zod.uuid(),user_id:zod.uuid(),route_id:zod.uuid(),metadata:zod.optional(zod.nullable(zod.record(zod.string(),zod.any()))),response:zod.optional(zod.nullable(zod.record(zod.string(),zod.any()))),side_effects:zod.boolean().default(true),input_asset_id:zod.optional(zod.nullable(zod.uuid())),output_asset_id:zod.optional(zod.nullable(zod.uuid())),input_asset:zod.optional(zod.nullable(chunkROMY5WNQ_cjs.c)),input_assets:zod.optional(zod.nullable(zod.array(zod.record(zod.string(),zod.any())))),output_asset:zod.optional(zod.nullable(chunkROMY5WNQ_cjs.c)),output_assets:zod.optional(zod.nullable(zod.array(zod.record(zod.string(),zod.any())))),webhook_url:zod.optional(zod.nullable(zod.string())),webhook_token:zod.optional(zod.nullable(zod.string())),status:chunk43KB23BA_cjs.j,created_at:zod.string(),last_updated:zod.string(),started_at:zod.optional(zod.nullable(zod.string())),ack_at:zod.optional(zod.nullable(zod.string())),upstream_status_code:zod.optional(zod.nullable(zod.number())),finished_at:zod.optional(zod.nullable(zod.string()))});exports.a=D;exports.b=C;exports.c=w;exports.d=x;exports.e=T;exports.f=O;exports.g=b;exports.h=g;exports.i=E;exports.j=F;exports.k=U;//# sourceMappingURL=chunk-V73EW77Y.cjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-V73EW77Y.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schema/services.ts"],"names":["AuthType","zodEnum","BaseServiceMetadataSchema","object","string","optional","nullable","ServiceMetadataSchema","AssetMetadataSchema","ServiceSchema","AssetSchema","AssetTypeSchema","x","CreateServiceSchema","CreateAssetSchema","value","normalizeAssetConfigForParsing","UpdateServiceSchema","ExecutionModeSchema","RouteAssetType","RouteInputFilter","RouteInputAssetDeclarationSchema","boolean","array","any","RouteOutputAssetDeclarationSchema","RouteInputAssetsSchema","record","RouteOutputAssetsSchema","RouteDetailSchema","number","RouteMetricsSchema","RouteSchema","ActionSchema","uuid","StatusSchema"],"mappings":"wIAuBA,IAAMA,EAAWC,QAAQ,CAAA,CAAC,uBAAyB,CAAA,MAAA,CAAQ,OAAQ,WAAW,CAAC,CAEzEC,CAAAA,CAAAA,CAA4BC,WAAO,CACvC,cAAA,CAAgBH,CAChB,CAAA,QAAA,CAAUI,YACV,CAAA,OAAA,CAASC,YAASC,CAAAA,YAAAA,CAASF,YAAQ,CAAC,CACpC,CAAA,SAAA,CAAWC,aAASC,YAASF,CAAAA,UAAAA,EAAQ,CAAC,EACtC,QAAUC,CAAAA,YAAAA,CAASC,YAASF,CAAAA,UAAAA,EAAQ,CAAC,CAAA,CACrC,QAAUC,CAAAA,YAAAA,CAASC,aAASF,UAAO,EAAC,CAAC,CACvC,CAAC,CAEKG,CAAAA,CAAAA,CAAwBL,CAA0B,CAAA,MAAA,CACtDM,oBAAoB,OAAQ,EAAA,CAAE,KAChC,CAAA,CAEMC,EAAgBC,mBAAY,CAAA,MAAA,CAAO,CACvC,UAAA,CAAYC,oBAAgB,MAAQC,CAAAA,CAAAA,EAAoBA,CAAd,GAAA,SAAe,EACzD,QAAUL,CAAAA,CACZ,CAAC,CAAA,CAEKM,EAAsBC,mBAAkB,CAAA,MAAA,CAAO,CACnD,UAAA,CAAYH,oBAAgB,MAAQC,CAAAA,CAAAA,EAAoBA,CAAd,GAAA,SAAe,EACzD,QAAUL,CAAAA,CACZ,CAAC,CAAA,CAAE,UAAWQ,CAAUC,EAAAA,mBAAAA,CAA+BD,CAAK,CAAC,EAEvDE,CAAsBR,CAAAA,CAAAA,CAAc,OAAQ,EAAA,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,CAEnC,CAAA,oBAAA,CAAsBC,YAASC,CAAAA,YAAAA,CAASwB,YAAQ,CAAC,CACjD,CAAA,WAAA,CAAazB,aAASC,YAASF,CAAAA,UAAAA,EAAQ,CAAC,CAC1C,CAAC","file":"chunk-V73EW77Y.cjs","sourcesContent":["import {\n object,\n string,\n uuid,\n number,\n array,\n type z,\n record,\n any,\n enum as zodEnum,\n optional,\n nullable,\n boolean\n} from \"zod\";\n\nimport { AssetTypeSchema, StatusSchema } from \"./common\";\nimport {\n AssetMetadataSchema,\n AssetSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\n\nconst AuthType = zodEnum([\"Personal Access Token\", \"Ouro\", \"None\", \"OAuth 2.0\"]);\n\nconst BaseServiceMetadataSchema = object({\n authentication: AuthType,\n base_url: string(),\n version: optional(nullable(string())),\n spec_path: optional(nullable(string())),\n spec_url: optional(nullable(string())),\n auth_url: optional(nullable(string())),\n});\n\nconst ServiceMetadataSchema = BaseServiceMetadataSchema.extend(\n AssetMetadataSchema.partial().shape\n);\n\nconst ServiceSchema = AssetSchema.extend({\n asset_type: AssetTypeSchema.refine((x) => \"service\" === x),\n metadata: ServiceMetadataSchema,\n});\n\nconst CreateServiceSchema = CreateAssetSchema.extend({\n asset_type: AssetTypeSchema.refine((x) => \"service\" === x),\n metadata: ServiceMetadataSchema,\n}).transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateServiceSchema = ServiceSchema.partial()\n .omit({\n user_id: true,\n id: true,\n created_at: true,\n last_updated: true,\n organization: true,\n user: true,\n team: true,\n slug: true,\n is_pinned_in_team: true,\n })\n .extend({\n last_updated: string().default(() => new Date().toISOString()),\n })\n .transform((value) => normalizeAssetConfigForParsing(value));\n\nconst ExecutionModeSchema = zodEnum([\"sync\", \"async\"]);\n\n// Asset type accepted in keyed `input_assets` / `output_assets` declarations.\nconst RouteAssetType = zodEnum([\"file\", \"dataset\", \"post\"]);\n\n// File-type filter accepted on file-input declarations.\nconst RouteInputFilter = zodEnum([\n \"audio\",\n \"video\",\n \"image\",\n \"pdf\",\n \"3d model\",\n \"atomic structure\",\n]);\n\n// Shape of a single keyed declaration in `routes.input_assets`. Plural\n// declarations are canonical; the legacy `input_type` and `input_file_*`\n// columns on the route row stay in sync as primary projections.\nconst RouteInputAssetDeclarationSchema = object({\n asset_type: RouteAssetType,\n primary: optional(boolean()),\n input_filter: optional(nullable(RouteInputFilter)),\n file_extensions: optional(nullable(array(string()))),\n contains_file_extensions: optional(nullable(array(string()))),\n}).catchall(any());\n\n// Shape of a single keyed declaration in `routes.output_assets`.\nconst RouteOutputAssetDeclarationSchema = object({\n asset_type: RouteAssetType,\n primary: optional(boolean()),\n file_extensions: optional(nullable(array(string()))),\n contains_file_extensions: optional(nullable(array(string()))),\n}).catchall(any());\n\nconst RouteInputAssetsSchema = record(\n string(),\n RouteInputAssetDeclarationSchema\n);\n\nconst RouteOutputAssetsSchema = record(\n string(),\n RouteOutputAssetDeclarationSchema\n);\n\nconst RouteDetailSchema = object({\n id: string(),\n user_id: string(),\n service_id: string(),\n path: string(),\n method: zodEnum([\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\"]),\n summary: optional(nullable(string())),\n parameters: optional(nullable(array(record(string(), any())))),\n request_body: optional(nullable(record(string(), any()))),\n responses: optional(nullable(array(record(string(), any())))),\n // Canonical plural input declarations keyed by request body field name.\n input_assets: optional(nullable(RouteInputAssetsSchema)),\n // Legacy primary projection — kept synchronized with `input_assets` for\n // older clients, indexing, and quick asset-type lookups.\n input_type: optional(nullable(RouteAssetType)),\n input_filter: optional(nullable(RouteInputFilter)),\n input_file_extension: optional(nullable(string())),\n input_file_extensions: optional(nullable(array(string()))),\n // Canonical plural output declarations keyed by response body field name.\n output_assets: optional(nullable(RouteOutputAssetsSchema)),\n // Legacy primary projection — kept synchronized with `output_assets`.\n output_type: optional(nullable(RouteAssetType)),\n output_file_extension: optional(nullable(string())),\n security: optional(nullable(record(string(), any()))),\n rate_limit: optional(nullable(number())),\n // Author-declared execution model: 'sync' = upstream returns the result\n // inline; 'async' = upstream returns 202 quickly and webhooks completion.\n execution_mode: optional(ExecutionModeSchema).default(\"sync\"),\n // Empirical mode derived by the platform from recent action history; null\n // until enough samples have been observed. When this differs from\n // execution_mode the route is misconfigured.\n observed_execution_mode: optional(nullable(ExecutionModeSchema)),\n last_updated: string(),\n});\n\n// Per-route latency aggregates surfaced from asset_metrics. All fields are\n// nullable because they don't exist until the platform has observed at least\n// one completed action for the route.\nconst RouteMetricsSchema = object({\n // Average HTTP-hop latency in milliseconds: time from request start until\n // upstream returned 200 or 202.\n avg_ack_ms: optional(nullable(number())),\n p95_ack_ms: optional(nullable(number())),\n // Average end-to-end latency in milliseconds: started_at to finished_at,\n // includes webhook completion for async routes. This is the value an\n // agent should consider when deciding whether to wait or poll.\n avg_completion_ms: optional(nullable(number())),\n p95_completion_ms: optional(nullable(number())),\n latency_sample_count: optional(nullable(number())),\n});\n\nconst RouteSchema = AssetSchema.extend({\n asset_type: AssetTypeSchema.refine((x) => \"route\" === x),\n route: RouteDetailSchema,\n // Latency aggregates joined from asset_metrics; null when no samples yet.\n metrics: optional(nullable(RouteMetricsSchema)),\n});\n\nconst ActionSchema = object({\n id: uuid(),\n user_id: uuid(),\n route_id: uuid(),\n metadata: optional(nullable(record(string(), any()))),\n response: optional(nullable(record(string(), any()))),\n side_effects: boolean().default(true),\n input_asset_id: optional(nullable(uuid())),\n output_asset_id: optional(nullable(uuid())),\n input_asset: optional(nullable(AssetSchema)),\n input_assets: optional(nullable(array(record(string(), any())))),\n output_asset: optional(nullable(AssetSchema)),\n output_assets: optional(nullable(array(record(string(), any())))),\n webhook_url: optional(nullable(string())),\n webhook_token: optional(nullable(string())),\n status: StatusSchema,\n created_at: string(),\n last_updated: string(),\n started_at: optional(nullable(string())),\n // When the upstream service first responded (200 or 202). For sync routes\n // this is approximately equal to finished_at; for async routes the gap\n // between ack_at and finished_at is the out-of-band wait time.\n ack_at: optional(nullable(string())),\n // HTTP status code returned by the upstream service at ack time.\n upstream_status_code: optional(nullable(number())),\n finished_at: optional(nullable(string())),\n});\n\nexport {\n RouteSchema,\n RouteInputAssetDeclarationSchema,\n RouteOutputAssetDeclarationSchema,\n RouteInputAssetsSchema,\n RouteOutputAssetsSchema,\n ServiceSchema,\n CreateServiceSchema,\n UpdateServiceSchema,\n ActionSchema,\n RouteMetricsSchema,\n ExecutionModeSchema,\n};\nexport type Service = z.infer<typeof ServiceSchema>;\nexport type Route = z.infer<typeof RouteSchema>;\nexport type RouteDetail = z.infer<typeof RouteDetailSchema>;\nexport type RouteMetrics = z.infer<typeof RouteMetricsSchema>;\nexport type RouteInputAssetDeclaration = z.infer<typeof RouteInputAssetDeclarationSchema>;\nexport type RouteOutputAssetDeclaration = z.infer<typeof RouteOutputAssetDeclarationSchema>;\nexport type RouteInputAssets = z.infer<typeof RouteInputAssetsSchema>;\nexport type RouteOutputAssets = z.infer<typeof RouteOutputAssetsSchema>;\nexport type ExecutionMode = z.infer<typeof ExecutionModeSchema>;\nexport type AuthType = z.infer<typeof AuthType>;\nexport type Action = z.infer<typeof ActionSchema>;\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkMOEVC3KD_cjs=require('./chunk-MOEVC3KD.cjs'),chunkVGNECRJJ_cjs=require('./chunk-VGNECRJJ.cjs'),chunkL2EAP5SJ_cjs=require('./chunk-L2EAP5SJ.cjs'),chunkN6AJDETI_cjs=require('./chunk-N6AJDETI.cjs'),chunk6XQFD2Z2_cjs=require('./chunk-6XQFD2Z2.cjs'),chunk4K6R6FZD_cjs=require('./chunk-4K6R6FZD.cjs'),chunk6FG474SV_cjs=require('./chunk-6FG474SV.cjs'),chunkHN7Y7VMJ_cjs=require('./chunk-HN7Y7VMJ.cjs'),chunkT4BUMCXS_cjs=require('./chunk-T4BUMCXS.cjs'),chunkOFDJA6ZW_cjs=require('./chunk-OFDJA6ZW.cjs'),chunkUORCDNEC_cjs=require('./chunk-UORCDNEC.cjs'),chunkFRMPLGE4_cjs=require('./chunk-FRMPLGE4.cjs'),chunkNJQ5YWYJ_cjs=require('./chunk-NJQ5YWYJ.cjs'),chunkDC6TYS3A_cjs=require('./chunk-DC6TYS3A.cjs'),chunkOBWPO2QT_cjs=require('./chunk-OBWPO2QT.cjs'),chunkROMY5WNQ_cjs=require('./chunk-ROMY5WNQ.cjs'),chunkUY43EQTO_cjs=require('./chunk-UY43EQTO.cjs'),chunkVOY623ZD_cjs=require('./chunk-VOY623ZD.cjs'),chunkGY6SLMMJ_cjs=require('./chunk-GY6SLMMJ.cjs'),chunk43KB23BA_cjs=require('./chunk-43KB23BA.cjs');require('./chunk-7HF5VHUN.cjs');var chunkG24BRDHO_cjs=require('./chunk-G24BRDHO.cjs');Object.defineProperty(exports,"createNameUrlSlug",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.a}});Object.defineProperty(exports,"createUrlSlug",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.b}});Object.defineProperty(exports,"getAssetUrl",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.c}});Object.defineProperty(exports,"filterListToString",{enumerable:true,get:function(){return chunkVGNECRJJ_cjs.a}});Object.defineProperty(exports,"getReferencesInContent",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.e}});Object.defineProperty(exports,"normalizeViewMode",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.a}});Object.defineProperty(exports,"parseAssetLinkShorthand",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.c}});Object.defineProperty(exports,"parseOuroAssetUrl",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.d}});Object.defineProperty(exports,"resolveDisplayConfig",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.b}});Object.defineProperty(exports,"parseMarkdown",{enumerable:true,get:function(){return chunkN6AJDETI_cjs.a}});Object.defineProperty(exports,"CreateFileSchema",{enumerable:true,get:function(){return chunk6XQFD2Z2_cjs.b}});Object.defineProperty(exports,"FileSchema",{enumerable:true,get:function(){return chunk6XQFD2Z2_cjs.a}});Object.defineProperty(exports,"updateFileSchema",{enumerable:true,get:function(){return chunk6XQFD2Z2_cjs.c}});Object.defineProperty(exports,"NotificationSchema",{enumerable:true,get:function(){return chunk4K6R6FZD_cjs.a}});Object.defineProperty(exports,"CreateEntrySchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.p}});Object.defineProperty(exports,"CreateQuestItemObjectSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.i}});Object.defineProperty(exports,"CreateQuestItemSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.j}});Object.defineProperty(exports,"CreateQuestSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.l}});Object.defineProperty(exports,"EntryEvalStatusSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.e}});Object.defineProperty(exports,"EntrySchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.o}});Object.defineProperty(exports,"EntryStatusSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.f}});Object.defineProperty(exports,"QuestItemBaseSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.g}});Object.defineProperty(exports,"QuestItemSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.h}});Object.defineProperty(exports,"QuestItemStatusSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.c}});Object.defineProperty(exports,"QuestSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.k}});Object.defineProperty(exports,"QuestStatusSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.b}});Object.defineProperty(exports,"QuestTypeSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.a}});Object.defineProperty(exports,"ReviewEntrySchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.q}});Object.defineProperty(exports,"RewardCurrencySchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.d}});Object.defineProperty(exports,"UpdateQuestItemSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.n}});Object.defineProperty(exports,"UpdateQuestSchema",{enumerable:true,get:function(){return chunk6FG474SV_cjs.m}});Object.defineProperty(exports,"KeyedAssetInputSchema",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.c}});Object.defineProperty(exports,"KeyedAssetRefsSchema",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.a}});Object.defineProperty(exports,"QuestSubmissionAssetDeclarationSchema",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.d}});Object.defineProperty(exports,"assetMatchesDeclaration",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.k}});Object.defineProperty(exports,"declarationToPickerFilters",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.j}});Object.defineProperty(exports,"declarationToSubmissionDeclaration",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.f}});Object.defineProperty(exports,"getPrimaryAssetRef",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.l}});Object.defineProperty(exports,"getPrimaryDeclarationKey",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.h}});Object.defineProperty(exports,"getRouteInputDeclarationsFromRoute",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.e}});Object.defineProperty(exports,"getSubmissionAssetShape",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.i}});Object.defineProperty(exports,"materializeContributorSubmissionAssets",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.g}});Object.defineProperty(exports,"toRouteInputAssets",{enumerable:true,get:function(){return chunkHN7Y7VMJ_cjs.m}});Object.defineProperty(exports,"reactionSchema",{enumerable:true,get:function(){return chunkT4BUMCXS_cjs.a}});Object.defineProperty(exports,"ActionSchema",{enumerable:true,get:function(){return chunkOFDJA6ZW_cjs.k}});Object.defineProperty(exports,"CreateServiceSchema",{enumerable:true,get:function(){return chunkOFDJA6ZW_cjs.b}});Object.defineProperty(exports,"ExecutionModeSchema",{enumerable:true,get:function(){return chunkOFDJA6ZW_cjs.d}});Object.defineProperty(exports,"RouteInputAssetDeclarationSchema",{enumerable:true,get:function(){return chunkOFDJA6ZW_cjs.e}});Object.defineProperty(exports,"RouteInputAssetsSchema",{enumerable:true,get:function(){return chunkOFDJA6ZW_cjs.g}});Object.defineProperty(exports,"RouteMetricsSchema",{enumerable:true,get:function(){return chunkOFDJA6ZW_cjs.i}});Object.defineProperty(exports,"RouteOutputAssetDeclarationSchema",{enumerable:true,get:function(){return chunkOFDJA6ZW_cjs.f}});Object.defineProperty(exports,"RouteOutputAssetsSchema",{enumerable:true,get:function(){return chunkOFDJA6ZW_cjs.h}});Object.defineProperty(exports,"RouteSchema",{enumerable:true,get:function(){return chunkOFDJA6ZW_cjs.j}});Object.defineProperty(exports,"ServiceSchema",{enumerable:true,get:function(){return chunkOFDJA6ZW_cjs.a}});Object.defineProperty(exports,"UpdateServiceSchema",{enumerable:true,get:function(){return chunkOFDJA6ZW_cjs.c}});Object.defineProperty(exports,"AssetTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.e}});Object.defineProperty(exports,"AssetTagWithTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.f}});Object.defineProperty(exports,"CreateAssetTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.g}});Object.defineProperty(exports,"TagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.c}});Object.defineProperty(exports,"TagSourceSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.b}});Object.defineProperty(exports,"TagTypeSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.a}});Object.defineProperty(exports,"TagWithParentSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.d}});Object.defineProperty(exports,"TagsByTypeSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.h}});Object.defineProperty(exports,"CommentSchema",{enumerable:true,get:function(){return chunkFRMPLGE4_cjs.a}});Object.defineProperty(exports,"CreateCommentSchema",{enumerable:true,get:function(){return chunkFRMPLGE4_cjs.b}});Object.defineProperty(exports,"ConversationSchema",{enumerable:true,get:function(){return chunkNJQ5YWYJ_cjs.a}});Object.defineProperty(exports,"CreateConversationSchema",{enumerable:true,get:function(){return chunkNJQ5YWYJ_cjs.b}});Object.defineProperty(exports,"MessageSchema",{enumerable:true,get:function(){return chunkNJQ5YWYJ_cjs.d}});Object.defineProperty(exports,"UpdateConversationSchema",{enumerable:true,get:function(){return chunkNJQ5YWYJ_cjs.c}});Object.defineProperty(exports,"ContentSchema",{enumerable:true,get:function(){return chunkDC6TYS3A_cjs.b}});Object.defineProperty(exports,"CreatePostSchema",{enumerable:true,get:function(){return chunkDC6TYS3A_cjs.d}});Object.defineProperty(exports,"ListPostsSchema",{enumerable:true,get:function(){return chunkDC6TYS3A_cjs.g}});Object.defineProperty(exports,"PostSchema",{enumerable:true,get:function(){return chunkDC6TYS3A_cjs.c}});Object.defineProperty(exports,"ReadPostSchema",{enumerable:true,get:function(){return chunkDC6TYS3A_cjs.e}});Object.defineProperty(exports,"ReadPostsSchema",{enumerable:true,get:function(){return chunkDC6TYS3A_cjs.f}});Object.defineProperty(exports,"TipTapSchema",{enumerable:true,get:function(){return chunkDC6TYS3A_cjs.a}});Object.defineProperty(exports,"UpdatePostSchema",{enumerable:true,get:function(){return chunkDC6TYS3A_cjs.h}});Object.defineProperty(exports,"CreateDatasetFromFileSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.f}});Object.defineProperty(exports,"CreateDatasetFromSchemaSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.g}});Object.defineProperty(exports,"DatasetAssetRefsSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.a}});Object.defineProperty(exports,"DatasetSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.e}});Object.defineProperty(exports,"EnrichedDatasetSchemaFieldSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.b}});Object.defineProperty(exports,"ResolvedAssetRefSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.c}});Object.defineProperty(exports,"ResolvedAssetRefsSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.d}});Object.defineProperty(exports,"updateDatasetSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.h}});Object.defineProperty(exports,"AssetMetadataSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.b}});Object.defineProperty(exports,"AssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.c}});Object.defineProperty(exports,"CreateAssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.d}});Object.defineProperty(exports,"UpdateAssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.e}});Object.defineProperty(exports,"normalizeAssetConfigForParsing",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.a}});Object.defineProperty(exports,"CreateTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.b}});Object.defineProperty(exports,"ReadTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.c}});Object.defineProperty(exports,"ReadTeamsSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.d}});Object.defineProperty(exports,"TeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.a}});Object.defineProperty(exports,"UpdateTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.e}});Object.defineProperty(exports,"ActorTypePolicySchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.a}});Object.defineProperty(exports,"MembershipSchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.d}});Object.defineProperty(exports,"OrganizationsSchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.c}});Object.defineProperty(exports,"SourcePolicySchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.b}});Object.defineProperty(exports,"ActorTypeSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.a}});Object.defineProperty(exports,"ProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.b}});Object.defineProperty(exports,"ReadProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.c}});Object.defineProperty(exports,"UpdateProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.d}});Object.defineProperty(exports,"AssetTypeSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.a}});Object.defineProperty(exports,"ConnectionSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.g}});Object.defineProperty(exports,"EmbeddingSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.f}});Object.defineProperty(exports,"MonetizationSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.d}});Object.defineProperty(exports,"PermissionSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.i}});Object.defineProperty(exports,"PriceCurrencySchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.e}});Object.defineProperty(exports,"PurchaseAssetSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.h}});Object.defineProperty(exports,"RoleSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.c}});Object.defineProperty(exports,"SourceSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.k}});Object.defineProperty(exports,"StatusSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.j}});Object.defineProperty(exports,"VisibilitySchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.b}});Object.defineProperty(exports,"USER_SUBSCRIBABLE_WEBHOOK_EVENTS",{enumerable:true,get:function(){return chunkG24BRDHO_cjs.c}});Object.defineProperty(exports,"WEBHOOK_EVENTS",{enumerable:true,get:function(){return chunkG24BRDHO_cjs.a}});Object.defineProperty(exports,"WEBHOOK_EVENT_TYPES",{enumerable:true,get:function(){return chunkG24BRDHO_cjs.b}});//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var chunkMOEVC3KD_cjs=require('./chunk-MOEVC3KD.cjs'),chunkVGNECRJJ_cjs=require('./chunk-VGNECRJJ.cjs'),chunkL2EAP5SJ_cjs=require('./chunk-L2EAP5SJ.cjs'),chunkN6AJDETI_cjs=require('./chunk-N6AJDETI.cjs'),chunk6GPIZJ4T_cjs=require('./chunk-6GPIZJ4T.cjs'),chunk4K6R6FZD_cjs=require('./chunk-4K6R6FZD.cjs'),chunkBWAEBQKV_cjs=require('./chunk-BWAEBQKV.cjs'),chunk6ZJQTECB_cjs=require('./chunk-6ZJQTECB.cjs'),chunkT4BUMCXS_cjs=require('./chunk-T4BUMCXS.cjs'),chunkV73EW77Y_cjs=require('./chunk-V73EW77Y.cjs'),chunkUORCDNEC_cjs=require('./chunk-UORCDNEC.cjs'),chunkFRMPLGE4_cjs=require('./chunk-FRMPLGE4.cjs'),chunkHIXNQKVP_cjs=require('./chunk-HIXNQKVP.cjs'),chunkF5CWCYOP_cjs=require('./chunk-F5CWCYOP.cjs'),chunkOBWPO2QT_cjs=require('./chunk-OBWPO2QT.cjs'),chunkROMY5WNQ_cjs=require('./chunk-ROMY5WNQ.cjs'),chunkUY43EQTO_cjs=require('./chunk-UY43EQTO.cjs'),chunkVOY623ZD_cjs=require('./chunk-VOY623ZD.cjs'),chunkGY6SLMMJ_cjs=require('./chunk-GY6SLMMJ.cjs'),chunk43KB23BA_cjs=require('./chunk-43KB23BA.cjs');require('./chunk-7HF5VHUN.cjs');var chunkG24BRDHO_cjs=require('./chunk-G24BRDHO.cjs');Object.defineProperty(exports,"createNameUrlSlug",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.a}});Object.defineProperty(exports,"createUrlSlug",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.b}});Object.defineProperty(exports,"getAssetUrl",{enumerable:true,get:function(){return chunkMOEVC3KD_cjs.c}});Object.defineProperty(exports,"filterListToString",{enumerable:true,get:function(){return chunkVGNECRJJ_cjs.a}});Object.defineProperty(exports,"getReferencesInContent",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.e}});Object.defineProperty(exports,"normalizeViewMode",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.a}});Object.defineProperty(exports,"parseAssetLinkShorthand",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.c}});Object.defineProperty(exports,"parseOuroAssetUrl",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.d}});Object.defineProperty(exports,"resolveDisplayConfig",{enumerable:true,get:function(){return chunkL2EAP5SJ_cjs.b}});Object.defineProperty(exports,"parseMarkdown",{enumerable:true,get:function(){return chunkN6AJDETI_cjs.a}});Object.defineProperty(exports,"CreateFileSchema",{enumerable:true,get:function(){return chunk6GPIZJ4T_cjs.b}});Object.defineProperty(exports,"FileSchema",{enumerable:true,get:function(){return chunk6GPIZJ4T_cjs.a}});Object.defineProperty(exports,"updateFileSchema",{enumerable:true,get:function(){return chunk6GPIZJ4T_cjs.c}});Object.defineProperty(exports,"NotificationSchema",{enumerable:true,get:function(){return chunk4K6R6FZD_cjs.a}});Object.defineProperty(exports,"CreateEntrySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.p}});Object.defineProperty(exports,"CreateQuestItemObjectSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.i}});Object.defineProperty(exports,"CreateQuestItemSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.j}});Object.defineProperty(exports,"CreateQuestSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.l}});Object.defineProperty(exports,"EntryEvalStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.e}});Object.defineProperty(exports,"EntrySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.o}});Object.defineProperty(exports,"EntryStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.f}});Object.defineProperty(exports,"QuestItemBaseSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.g}});Object.defineProperty(exports,"QuestItemSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.h}});Object.defineProperty(exports,"QuestItemStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.c}});Object.defineProperty(exports,"QuestSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.k}});Object.defineProperty(exports,"QuestStatusSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.b}});Object.defineProperty(exports,"QuestTypeSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.a}});Object.defineProperty(exports,"ReviewEntrySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.q}});Object.defineProperty(exports,"RewardCurrencySchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.d}});Object.defineProperty(exports,"UpdateQuestItemSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.n}});Object.defineProperty(exports,"UpdateQuestSchema",{enumerable:true,get:function(){return chunkBWAEBQKV_cjs.m}});Object.defineProperty(exports,"KeyedAssetInputSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.c}});Object.defineProperty(exports,"KeyedAssetRefsSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.a}});Object.defineProperty(exports,"QuestSubmissionAssetDeclarationSchema",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.d}});Object.defineProperty(exports,"assetMatchesDeclaration",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.k}});Object.defineProperty(exports,"declarationToPickerFilters",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.j}});Object.defineProperty(exports,"declarationToSubmissionDeclaration",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.f}});Object.defineProperty(exports,"getPrimaryAssetRef",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.l}});Object.defineProperty(exports,"getPrimaryDeclarationKey",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.h}});Object.defineProperty(exports,"getRouteInputDeclarationsFromRoute",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.e}});Object.defineProperty(exports,"getSubmissionAssetShape",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.i}});Object.defineProperty(exports,"materializeContributorSubmissionAssets",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.g}});Object.defineProperty(exports,"toRouteInputAssets",{enumerable:true,get:function(){return chunk6ZJQTECB_cjs.m}});Object.defineProperty(exports,"reactionSchema",{enumerable:true,get:function(){return chunkT4BUMCXS_cjs.a}});Object.defineProperty(exports,"ActionSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.k}});Object.defineProperty(exports,"CreateServiceSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.b}});Object.defineProperty(exports,"ExecutionModeSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.d}});Object.defineProperty(exports,"RouteInputAssetDeclarationSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.e}});Object.defineProperty(exports,"RouteInputAssetsSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.g}});Object.defineProperty(exports,"RouteMetricsSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.i}});Object.defineProperty(exports,"RouteOutputAssetDeclarationSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.f}});Object.defineProperty(exports,"RouteOutputAssetsSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.h}});Object.defineProperty(exports,"RouteSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.j}});Object.defineProperty(exports,"ServiceSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.a}});Object.defineProperty(exports,"UpdateServiceSchema",{enumerable:true,get:function(){return chunkV73EW77Y_cjs.c}});Object.defineProperty(exports,"AssetTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.e}});Object.defineProperty(exports,"AssetTagWithTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.f}});Object.defineProperty(exports,"CreateAssetTagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.g}});Object.defineProperty(exports,"TagSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.c}});Object.defineProperty(exports,"TagSourceSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.b}});Object.defineProperty(exports,"TagTypeSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.a}});Object.defineProperty(exports,"TagWithParentSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.d}});Object.defineProperty(exports,"TagsByTypeSchema",{enumerable:true,get:function(){return chunkUORCDNEC_cjs.h}});Object.defineProperty(exports,"CommentSchema",{enumerable:true,get:function(){return chunkFRMPLGE4_cjs.a}});Object.defineProperty(exports,"CreateCommentSchema",{enumerable:true,get:function(){return chunkFRMPLGE4_cjs.b}});Object.defineProperty(exports,"ConversationSchema",{enumerable:true,get:function(){return chunkHIXNQKVP_cjs.a}});Object.defineProperty(exports,"CreateConversationSchema",{enumerable:true,get:function(){return chunkHIXNQKVP_cjs.b}});Object.defineProperty(exports,"MessageSchema",{enumerable:true,get:function(){return chunkHIXNQKVP_cjs.d}});Object.defineProperty(exports,"UpdateConversationSchema",{enumerable:true,get:function(){return chunkHIXNQKVP_cjs.c}});Object.defineProperty(exports,"ContentSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.b}});Object.defineProperty(exports,"CreatePostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.d}});Object.defineProperty(exports,"ListPostsSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.g}});Object.defineProperty(exports,"PostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.c}});Object.defineProperty(exports,"ReadPostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.e}});Object.defineProperty(exports,"ReadPostsSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.f}});Object.defineProperty(exports,"TipTapSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.a}});Object.defineProperty(exports,"UpdatePostSchema",{enumerable:true,get:function(){return chunkF5CWCYOP_cjs.h}});Object.defineProperty(exports,"CreateDatasetFromFileSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.f}});Object.defineProperty(exports,"CreateDatasetFromSchemaSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.g}});Object.defineProperty(exports,"DatasetAssetRefsSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.a}});Object.defineProperty(exports,"DatasetSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.e}});Object.defineProperty(exports,"EnrichedDatasetSchemaFieldSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.b}});Object.defineProperty(exports,"ResolvedAssetRefSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.c}});Object.defineProperty(exports,"ResolvedAssetRefsSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.d}});Object.defineProperty(exports,"updateDatasetSchema",{enumerable:true,get:function(){return chunkOBWPO2QT_cjs.h}});Object.defineProperty(exports,"AssetMetadataSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.b}});Object.defineProperty(exports,"AssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.c}});Object.defineProperty(exports,"CreateAssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.d}});Object.defineProperty(exports,"UpdateAssetSchema",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.e}});Object.defineProperty(exports,"normalizeAssetConfigForParsing",{enumerable:true,get:function(){return chunkROMY5WNQ_cjs.a}});Object.defineProperty(exports,"CreateTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.b}});Object.defineProperty(exports,"ReadTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.c}});Object.defineProperty(exports,"ReadTeamsSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.d}});Object.defineProperty(exports,"TeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.a}});Object.defineProperty(exports,"UpdateTeamSchema",{enumerable:true,get:function(){return chunkUY43EQTO_cjs.e}});Object.defineProperty(exports,"ActorTypePolicySchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.a}});Object.defineProperty(exports,"MembershipSchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.d}});Object.defineProperty(exports,"OrganizationsSchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.c}});Object.defineProperty(exports,"SourcePolicySchema",{enumerable:true,get:function(){return chunkVOY623ZD_cjs.b}});Object.defineProperty(exports,"ActorTypeSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.a}});Object.defineProperty(exports,"ProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.b}});Object.defineProperty(exports,"ReadProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.c}});Object.defineProperty(exports,"UpdateProfileSchema",{enumerable:true,get:function(){return chunkGY6SLMMJ_cjs.d}});Object.defineProperty(exports,"AssetTypeSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.a}});Object.defineProperty(exports,"ConnectionSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.g}});Object.defineProperty(exports,"EmbeddingSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.f}});Object.defineProperty(exports,"MonetizationSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.d}});Object.defineProperty(exports,"PermissionSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.i}});Object.defineProperty(exports,"PriceCurrencySchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.e}});Object.defineProperty(exports,"PurchaseAssetSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.h}});Object.defineProperty(exports,"RoleSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.c}});Object.defineProperty(exports,"SourceSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.k}});Object.defineProperty(exports,"StatusSchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.j}});Object.defineProperty(exports,"VisibilitySchema",{enumerable:true,get:function(){return chunk43KB23BA_cjs.b}});Object.defineProperty(exports,"USER_SUBSCRIBABLE_WEBHOOK_EVENTS",{enumerable:true,get:function(){return chunkG24BRDHO_cjs.c}});Object.defineProperty(exports,"WEBHOOK_EVENTS",{enumerable:true,get:function(){return chunkG24BRDHO_cjs.a}});Object.defineProperty(exports,"WEBHOOK_EVENT_TYPES",{enumerable:true,get:function(){return chunkG24BRDHO_cjs.b}});//# sourceMappingURL=index.cjs.map
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as createNameUrlSlug,b as createUrlSlug,c as getAssetUrl}from'./chunk-EY4OFSDP.js';export{a as filterListToString}from'./chunk-OJQM6MWS.js';export{e as getReferencesInContent,a as normalizeViewMode,c as parseAssetLinkShorthand,d as parseOuroAssetUrl,b as resolveDisplayConfig}from'./chunk-PONEAJK7.js';export{a as parseMarkdown}from'./chunk-DE2Z5AOM.js';export{b as CreateFileSchema,a as FileSchema,c as updateFileSchema}from'./chunk-
|
|
1
|
+
export{a as createNameUrlSlug,b as createUrlSlug,c as getAssetUrl}from'./chunk-EY4OFSDP.js';export{a as filterListToString}from'./chunk-OJQM6MWS.js';export{e as getReferencesInContent,a as normalizeViewMode,c as parseAssetLinkShorthand,d as parseOuroAssetUrl,b as resolveDisplayConfig}from'./chunk-PONEAJK7.js';export{a as parseMarkdown}from'./chunk-DE2Z5AOM.js';export{b as CreateFileSchema,a as FileSchema,c as updateFileSchema}from'./chunk-KCVE35IO.js';export{a as NotificationSchema}from'./chunk-JISPX5A6.js';export{p as CreateEntrySchema,i as CreateQuestItemObjectSchema,j as CreateQuestItemSchema,l as CreateQuestSchema,e as EntryEvalStatusSchema,o as EntrySchema,f as EntryStatusSchema,g as QuestItemBaseSchema,h as QuestItemSchema,c as QuestItemStatusSchema,k as QuestSchema,b as QuestStatusSchema,a as QuestTypeSchema,q as ReviewEntrySchema,d as RewardCurrencySchema,n as UpdateQuestItemSchema,m as UpdateQuestSchema}from'./chunk-R2W4NEEJ.js';export{c as KeyedAssetInputSchema,a as KeyedAssetRefsSchema,d as QuestSubmissionAssetDeclarationSchema,k as assetMatchesDeclaration,j as declarationToPickerFilters,f as declarationToSubmissionDeclaration,l as getPrimaryAssetRef,h as getPrimaryDeclarationKey,e as getRouteInputDeclarationsFromRoute,i as getSubmissionAssetShape,g as materializeContributorSubmissionAssets,m as toRouteInputAssets}from'./chunk-TYOQ32UV.js';export{a as reactionSchema}from'./chunk-WE6CXCEQ.js';export{k as ActionSchema,b as CreateServiceSchema,d as ExecutionModeSchema,e as RouteInputAssetDeclarationSchema,g as RouteInputAssetsSchema,i as RouteMetricsSchema,f as RouteOutputAssetDeclarationSchema,h as RouteOutputAssetsSchema,j as RouteSchema,a as ServiceSchema,c as UpdateServiceSchema}from'./chunk-MLTO7TMM.js';export{e as AssetTagSchema,f as AssetTagWithTagSchema,g as CreateAssetTagSchema,c as TagSchema,b as TagSourceSchema,a as TagTypeSchema,d as TagWithParentSchema,h as TagsByTypeSchema}from'./chunk-EEXD7LGK.js';export{a as CommentSchema,b as CreateCommentSchema}from'./chunk-G3VMEPTP.js';export{a as ConversationSchema,b as CreateConversationSchema,d as MessageSchema,c as UpdateConversationSchema}from'./chunk-35CJDNHH.js';export{b as ContentSchema,d as CreatePostSchema,g as ListPostsSchema,c as PostSchema,e as ReadPostSchema,f as ReadPostsSchema,a as TipTapSchema,h as UpdatePostSchema}from'./chunk-IWOXGKK4.js';export{f as CreateDatasetFromFileSchema,g as CreateDatasetFromSchemaSchema,a as DatasetAssetRefsSchema,e as DatasetSchema,b as EnrichedDatasetSchemaFieldSchema,c as ResolvedAssetRefSchema,d as ResolvedAssetRefsSchema,h as updateDatasetSchema}from'./chunk-3UWDQLTN.js';export{b as AssetMetadataSchema,c as AssetSchema,d as CreateAssetSchema,e as UpdateAssetSchema,a as normalizeAssetConfigForParsing}from'./chunk-SR5UZ4NP.js';export{b as CreateTeamSchema,c as ReadTeamSchema,d as ReadTeamsSchema,a as TeamSchema,e as UpdateTeamSchema}from'./chunk-CF56NFUG.js';export{a as ActorTypePolicySchema,d as MembershipSchema,c as OrganizationsSchema,b as SourcePolicySchema}from'./chunk-WLGOABHV.js';export{a as ActorTypeSchema,b as ProfileSchema,c as ReadProfileSchema,d as UpdateProfileSchema}from'./chunk-3N56ERWF.js';export{a as AssetTypeSchema,g as ConnectionSchema,f as EmbeddingSchema,d as MonetizationSchema,i as PermissionSchema,e as PriceCurrencySchema,h as PurchaseAssetSchema,c as RoleSchema,k as SourceSchema,j as StatusSchema,b as VisibilitySchema}from'./chunk-WRHPQNEL.js';import'./chunk-DUBPWSCA.js';export{c as USER_SUBSCRIBABLE_WEBHOOK_EVENTS,a as WEBHOOK_EVENTS,b as WEBHOOK_EVENT_TYPES}from'./chunk-CIWFH5BJ.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/schema/assets.d.cts
CHANGED
|
@@ -127,9 +127,9 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
127
127
|
none: "none";
|
|
128
128
|
}>>;
|
|
129
129
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
130
|
-
organization: "organization";
|
|
131
130
|
public: "public";
|
|
132
131
|
private: "private";
|
|
132
|
+
organization: "organization";
|
|
133
133
|
monetized: "monetized";
|
|
134
134
|
inherit: "inherit";
|
|
135
135
|
}>>;
|
|
@@ -194,11 +194,11 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
194
194
|
license_id: z.ZodString;
|
|
195
195
|
license: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
196
196
|
asset_type: z.ZodEnum<{
|
|
197
|
-
user: "user";
|
|
198
197
|
organization: "organization";
|
|
198
|
+
file: "file";
|
|
199
|
+
user: "user";
|
|
199
200
|
team: "team";
|
|
200
201
|
dataset: "dataset";
|
|
201
|
-
file: "file";
|
|
202
202
|
service: "service";
|
|
203
203
|
route: "route";
|
|
204
204
|
post: "post";
|
|
@@ -214,9 +214,9 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
214
214
|
text: z.ZodString;
|
|
215
215
|
}, z.core.$strip>>>;
|
|
216
216
|
visibility: z.ZodEnum<{
|
|
217
|
-
organization: "organization";
|
|
218
217
|
public: "public";
|
|
219
218
|
private: "private";
|
|
219
|
+
organization: "organization";
|
|
220
220
|
monetized: "monetized";
|
|
221
221
|
inherit: "inherit";
|
|
222
222
|
}>;
|
|
@@ -255,26 +255,27 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
255
255
|
preview: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
|
|
256
256
|
state: z.ZodEnum<{
|
|
257
257
|
success: "success";
|
|
258
|
+
error: "error";
|
|
258
259
|
queued: "queued";
|
|
259
260
|
"in-progress": "in-progress";
|
|
260
261
|
"timed-out": "timed-out";
|
|
261
|
-
error: "error";
|
|
262
262
|
}>;
|
|
263
263
|
source: z.ZodEnum<{
|
|
264
|
-
api: "api";
|
|
265
264
|
web: "web";
|
|
265
|
+
api: "api";
|
|
266
266
|
}>;
|
|
267
267
|
is_pinned_in_team: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
268
268
|
created_at: z.ZodString;
|
|
269
269
|
last_updated: z.ZodString;
|
|
270
270
|
}, z.core.$strip>;
|
|
271
271
|
declare const CreateAssetSchema: z.ZodObject<{
|
|
272
|
+
parent: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
272
273
|
asset_type: z.ZodOptional<z.ZodEnum<{
|
|
273
|
-
user: "user";
|
|
274
274
|
organization: "organization";
|
|
275
|
+
file: "file";
|
|
276
|
+
user: "user";
|
|
275
277
|
team: "team";
|
|
276
278
|
dataset: "dataset";
|
|
277
|
-
file: "file";
|
|
278
279
|
service: "service";
|
|
279
280
|
route: "route";
|
|
280
281
|
post: "post";
|
|
@@ -282,29 +283,15 @@ declare const CreateAssetSchema: z.ZodObject<{
|
|
|
282
283
|
comment: "comment";
|
|
283
284
|
conversation: "conversation";
|
|
284
285
|
}>>;
|
|
285
|
-
parent: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
286
|
-
metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
287
|
-
doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
288
|
-
external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
289
|
-
paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
290
|
-
github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
291
|
-
originality: z.ZodEnum<{
|
|
292
|
-
original: "original";
|
|
293
|
-
derivative: "derivative";
|
|
294
|
-
"third-party": "third-party";
|
|
295
|
-
}>;
|
|
296
|
-
source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
297
|
-
reply_to_comment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
298
|
-
}, z.core.$strip>>>>;
|
|
299
|
-
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
300
|
-
json: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
301
|
-
text: z.ZodString;
|
|
302
|
-
}, z.core.$strip>>>>;
|
|
303
286
|
monetization: z.ZodOptional<z.ZodEnum<{
|
|
304
287
|
none: "none";
|
|
305
288
|
"pay-to-unlock": "pay-to-unlock";
|
|
306
289
|
"pay-per-use": "pay-per-use";
|
|
307
290
|
}>>;
|
|
291
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
292
|
+
json: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
293
|
+
text: z.ZodString;
|
|
294
|
+
}, z.core.$strip>>>>;
|
|
308
295
|
parent_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUUID>>>;
|
|
309
296
|
license_id: z.ZodOptional<z.ZodString>;
|
|
310
297
|
price: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
@@ -321,6 +308,19 @@ declare const CreateAssetSchema: z.ZodObject<{
|
|
|
321
308
|
stripe_product_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
322
309
|
stripe_price_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
323
310
|
stripe_meter_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
311
|
+
metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
312
|
+
doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
313
|
+
external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
314
|
+
paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
315
|
+
github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
316
|
+
originality: z.ZodEnum<{
|
|
317
|
+
original: "original";
|
|
318
|
+
derivative: "derivative";
|
|
319
|
+
"third-party": "third-party";
|
|
320
|
+
}>;
|
|
321
|
+
source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
322
|
+
reply_to_comment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
323
|
+
}, z.core.$strip>>>>;
|
|
324
324
|
preview: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>>>;
|
|
325
325
|
id: z.ZodDefault<z.ZodUUID>;
|
|
326
326
|
team_id: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
@@ -329,19 +329,19 @@ declare const CreateAssetSchema: z.ZodObject<{
|
|
|
329
329
|
name_url_slug: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
330
330
|
state: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
331
331
|
success: "success";
|
|
332
|
+
error: "error";
|
|
332
333
|
queued: "queued";
|
|
333
334
|
"in-progress": "in-progress";
|
|
334
335
|
"timed-out": "timed-out";
|
|
335
|
-
error: "error";
|
|
336
336
|
}>>>;
|
|
337
337
|
source: z.ZodDefault<z.ZodEnum<{
|
|
338
|
-
api: "api";
|
|
339
338
|
web: "web";
|
|
339
|
+
api: "api";
|
|
340
340
|
}>>;
|
|
341
341
|
visibility: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
342
|
-
organization: "organization";
|
|
343
342
|
public: "public";
|
|
344
343
|
private: "private";
|
|
344
|
+
organization: "organization";
|
|
345
345
|
monetized: "monetized";
|
|
346
346
|
inherit: "inherit";
|
|
347
347
|
}>>>;
|
|
@@ -349,12 +349,17 @@ declare const CreateAssetSchema: z.ZodObject<{
|
|
|
349
349
|
last_updated: z.ZodDefault<z.ZodString>;
|
|
350
350
|
}, z.core.$strip>;
|
|
351
351
|
declare const UpdateAssetSchema: z.ZodPipe<z.ZodObject<{
|
|
352
|
+
parent: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
353
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
354
|
+
web: "web";
|
|
355
|
+
api: "api";
|
|
356
|
+
}>>;
|
|
352
357
|
asset_type: z.ZodOptional<z.ZodEnum<{
|
|
353
|
-
user: "user";
|
|
354
358
|
organization: "organization";
|
|
359
|
+
file: "file";
|
|
360
|
+
user: "user";
|
|
355
361
|
team: "team";
|
|
356
362
|
dataset: "dataset";
|
|
357
|
-
file: "file";
|
|
358
363
|
service: "service";
|
|
359
364
|
route: "route";
|
|
360
365
|
post: "post";
|
|
@@ -362,39 +367,13 @@ declare const UpdateAssetSchema: z.ZodPipe<z.ZodObject<{
|
|
|
362
367
|
comment: "comment";
|
|
363
368
|
conversation: "conversation";
|
|
364
369
|
}>>;
|
|
365
|
-
org_id: z.ZodOptional<z.ZodUUID>;
|
|
366
|
-
parent: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
367
|
-
metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
368
|
-
doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
369
|
-
external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
370
|
-
paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
371
|
-
github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
372
|
-
originality: z.ZodEnum<{
|
|
373
|
-
original: "original";
|
|
374
|
-
derivative: "derivative";
|
|
375
|
-
"third-party": "third-party";
|
|
376
|
-
}>;
|
|
377
|
-
source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
378
|
-
reply_to_comment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
379
|
-
}, z.core.$strip>>>>;
|
|
380
|
-
last_updated: z.ZodOptional<z.ZodString>;
|
|
381
|
-
name: z.ZodOptional<z.ZodString>;
|
|
382
|
-
team_id: z.ZodOptional<z.ZodUUID>;
|
|
383
370
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
384
|
-
organization: "organization";
|
|
385
371
|
public: "public";
|
|
386
372
|
private: "private";
|
|
373
|
+
organization: "organization";
|
|
387
374
|
monetized: "monetized";
|
|
388
375
|
inherit: "inherit";
|
|
389
376
|
}>>;
|
|
390
|
-
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
391
|
-
json: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
392
|
-
text: z.ZodString;
|
|
393
|
-
}, z.core.$strip>>>>;
|
|
394
|
-
source: z.ZodOptional<z.ZodEnum<{
|
|
395
|
-
api: "api";
|
|
396
|
-
web: "web";
|
|
397
|
-
}>>;
|
|
398
377
|
monetization: z.ZodOptional<z.ZodEnum<{
|
|
399
378
|
none: "none";
|
|
400
379
|
"pay-to-unlock": "pay-to-unlock";
|
|
@@ -402,11 +381,18 @@ declare const UpdateAssetSchema: z.ZodPipe<z.ZodObject<{
|
|
|
402
381
|
}>>;
|
|
403
382
|
state: z.ZodOptional<z.ZodEnum<{
|
|
404
383
|
success: "success";
|
|
384
|
+
error: "error";
|
|
405
385
|
queued: "queued";
|
|
406
386
|
"in-progress": "in-progress";
|
|
407
387
|
"timed-out": "timed-out";
|
|
408
|
-
error: "error";
|
|
409
388
|
}>>;
|
|
389
|
+
name: z.ZodOptional<z.ZodString>;
|
|
390
|
+
org_id: z.ZodOptional<z.ZodUUID>;
|
|
391
|
+
team_id: z.ZodOptional<z.ZodUUID>;
|
|
392
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
393
|
+
json: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
394
|
+
text: z.ZodString;
|
|
395
|
+
}, z.core.$strip>>>>;
|
|
410
396
|
parent_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUUID>>>;
|
|
411
397
|
license_id: z.ZodOptional<z.ZodString>;
|
|
412
398
|
license: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
@@ -425,31 +411,35 @@ declare const UpdateAssetSchema: z.ZodPipe<z.ZodObject<{
|
|
|
425
411
|
stripe_product_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
426
412
|
stripe_price_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
427
413
|
stripe_meter_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
414
|
+
metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
415
|
+
doi_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
416
|
+
external_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
417
|
+
paper_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
418
|
+
github_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
419
|
+
originality: z.ZodEnum<{
|
|
420
|
+
original: "original";
|
|
421
|
+
derivative: "derivative";
|
|
422
|
+
"third-party": "third-party";
|
|
423
|
+
}>;
|
|
424
|
+
source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
425
|
+
reply_to_comment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
426
|
+
}, z.core.$strip>>>>;
|
|
428
427
|
preview: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>>>;
|
|
428
|
+
last_updated: z.ZodOptional<z.ZodString>;
|
|
429
429
|
}, z.core.$strip>, z.ZodTransform<{
|
|
430
|
-
asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "quest" | "comment" | "conversation" | undefined;
|
|
431
|
-
org_id?: string | undefined;
|
|
432
430
|
parent?: Record<string, any> | undefined;
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
github_url?: string | null | undefined;
|
|
439
|
-
source?: string | null | undefined;
|
|
440
|
-
reply_to_comment_id?: string | null | undefined;
|
|
441
|
-
} | null | undefined;
|
|
442
|
-
last_updated?: string | undefined;
|
|
431
|
+
source?: "web" | "api" | undefined;
|
|
432
|
+
asset_type?: "organization" | "file" | "user" | "team" | "dataset" | "service" | "route" | "post" | "quest" | "comment" | "conversation" | undefined;
|
|
433
|
+
visibility?: "public" | "private" | "organization" | "monetized" | "inherit" | undefined;
|
|
434
|
+
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
435
|
+
state?: "success" | "error" | "queued" | "in-progress" | "timed-out" | undefined;
|
|
443
436
|
name?: string | undefined;
|
|
437
|
+
org_id?: string | undefined;
|
|
444
438
|
team_id?: string | undefined;
|
|
445
|
-
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
446
439
|
description?: {
|
|
447
440
|
json: Record<string, any>;
|
|
448
441
|
text: string;
|
|
449
442
|
} | null | undefined;
|
|
450
|
-
source?: "api" | "web" | undefined;
|
|
451
|
-
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
452
|
-
state?: "success" | "queued" | "in-progress" | "timed-out" | "error" | undefined;
|
|
453
443
|
parent_id?: string | null | undefined;
|
|
454
444
|
license_id?: string | undefined;
|
|
455
445
|
license?: Record<string, any> | undefined;
|
|
@@ -462,11 +452,6 @@ declare const UpdateAssetSchema: z.ZodPipe<z.ZodObject<{
|
|
|
462
452
|
stripe_product_id?: string | null | undefined;
|
|
463
453
|
stripe_price_id?: string | null | undefined;
|
|
464
454
|
stripe_meter_id?: string | null | undefined;
|
|
465
|
-
preview?: Record<string, any>[] | null | undefined;
|
|
466
|
-
}, {
|
|
467
|
-
asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "quest" | "comment" | "conversation" | undefined;
|
|
468
|
-
org_id?: string | undefined;
|
|
469
|
-
parent?: Record<string, any> | undefined;
|
|
470
455
|
metadata?: {
|
|
471
456
|
originality: "original" | "derivative" | "third-party";
|
|
472
457
|
doi_url?: string | null | undefined;
|
|
@@ -476,17 +461,22 @@ declare const UpdateAssetSchema: z.ZodPipe<z.ZodObject<{
|
|
|
476
461
|
source?: string | null | undefined;
|
|
477
462
|
reply_to_comment_id?: string | null | undefined;
|
|
478
463
|
} | null | undefined;
|
|
464
|
+
preview?: Record<string, any>[] | null | undefined;
|
|
479
465
|
last_updated?: string | undefined;
|
|
466
|
+
}, {
|
|
467
|
+
parent?: Record<string, any> | undefined;
|
|
468
|
+
source?: "web" | "api" | undefined;
|
|
469
|
+
asset_type?: "organization" | "file" | "user" | "team" | "dataset" | "service" | "route" | "post" | "quest" | "comment" | "conversation" | undefined;
|
|
470
|
+
visibility?: "public" | "private" | "organization" | "monetized" | "inherit" | undefined;
|
|
471
|
+
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
472
|
+
state?: "success" | "error" | "queued" | "in-progress" | "timed-out" | undefined;
|
|
480
473
|
name?: string | undefined;
|
|
474
|
+
org_id?: string | undefined;
|
|
481
475
|
team_id?: string | undefined;
|
|
482
|
-
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
483
476
|
description?: {
|
|
484
477
|
json: Record<string, any>;
|
|
485
478
|
text: string;
|
|
486
479
|
} | null | undefined;
|
|
487
|
-
source?: "api" | "web" | undefined;
|
|
488
|
-
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
489
|
-
state?: "success" | "queued" | "in-progress" | "timed-out" | "error" | undefined;
|
|
490
480
|
parent_id?: string | null | undefined;
|
|
491
481
|
license_id?: string | undefined;
|
|
492
482
|
license?: Record<string, any> | undefined;
|
|
@@ -499,7 +489,17 @@ declare const UpdateAssetSchema: z.ZodPipe<z.ZodObject<{
|
|
|
499
489
|
stripe_product_id?: string | null | undefined;
|
|
500
490
|
stripe_price_id?: string | null | undefined;
|
|
501
491
|
stripe_meter_id?: string | null | undefined;
|
|
492
|
+
metadata?: {
|
|
493
|
+
originality: "original" | "derivative" | "third-party";
|
|
494
|
+
doi_url?: string | null | undefined;
|
|
495
|
+
external_url?: string | null | undefined;
|
|
496
|
+
paper_url?: string | null | undefined;
|
|
497
|
+
github_url?: string | null | undefined;
|
|
498
|
+
source?: string | null | undefined;
|
|
499
|
+
reply_to_comment_id?: string | null | undefined;
|
|
500
|
+
} | null | undefined;
|
|
502
501
|
preview?: Record<string, any>[] | null | undefined;
|
|
502
|
+
last_updated?: string | undefined;
|
|
503
503
|
}>>;
|
|
504
504
|
|
|
505
505
|
type AssetMetadata = z.infer<typeof AssetMetadataSchema>;
|