twenty-sdk 2.53.0 → 2.54.0
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/CHANGELOG.md +22 -0
- package/dist/billing/index.cjs.map +1 -1
- package/dist/billing/index.mjs.map +1 -1
- package/dist/define/index.cjs +9 -9
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +103 -51
- package/dist/define/index.mjs +2859 -2832
- package/dist/define/index.mjs.map +1 -1
- package/dist/front-component/index.cjs +1 -1
- package/dist/front-component/index.cjs.map +1 -1
- package/dist/front-component/index.d.ts +13 -2
- package/dist/front-component/index.mjs +8 -4
- package/dist/front-component/index.mjs.map +1 -1
- package/dist/front-component-renderer/build.cjs +440 -7
- package/dist/front-component-renderer/build.mjs +112125 -47
- package/dist/logic-function/index.cjs +4 -4
- package/dist/logic-function/index.cjs.map +1 -1
- package/dist/logic-function/index.d.ts +12 -2
- package/dist/logic-function/index.mjs +19 -15
- package/dist/logic-function/index.mjs.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.mjs +13 -9
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -109,7 +109,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
|
|
|
109
109
|
success
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
`,V=async({input:e,...t})=>{let{runAgent:n}=await h({query:B,variables:{input:r(e)?{...t,input:typeof e==`string`?[{role:`user`,content:e}]:e}:t},caller:`runAgent`});return n},ne=async e=>{let{sendInboxMessage:n}=await new t.MetadataApiClient().mutation({sendInboxMessage:{__args:{input:e},threadId:!0}});return n},H=/\[/g,U=/\]/g,W=/\r?\n/g,G=e=>e.replace(H,`(`).replace(U,`)`).replace(W,` `).trim(),K=async({workspaceMemberId:t})=>{let{data:{workspaceMember:r}}=await new n.RestApiClient().get(`/rest/workspaceMembers/${t}`),i=`${r.name.firstName??``} ${r.name.lastName??``}`.trim();return y({objectNameSingular:`workspaceMember`,recordId:t,displayName:G((0,e.isNonEmptyString)(i)?i:r.userEmail)})},q=({fullName:t,partName:n})=>{let r=(0,e.isObject)(t)?Reflect.get(t,n):void 0;return(0,e.isString)(r)?r:``},J=({record:e,recordId:t,labelIdentifierField:n})=>{if(!r(n))return t;let i=e[n.name];return n.type===`FULL_NAME`?`${q({fullName:i,partName:`firstName`})} ${q({fullName:i,partName:`lastName`})}`.trim():r(i)?String(i):``},Y=async({metadataClient:e,objectMetadata:t})=>{if(!r(t.labelIdentifierFieldMetadataId))return;let{object:n}=await e.query({object:{__args:{id:t.id},fields:{__args:{filter:{id:{eq:t.labelIdentifierFieldMetadataId}},paging:{first:1}},edges:{node:{name:!0,type:!0}}}}});return n.fields.edges[0]?.node},X=1e3,Z=async({metadataClient:e,objectNameSingular:t})=>{let{objects:n}=await e.query({objects:{__args:{filter:{},paging:{first:X}},edges:{node:{id:!0,nameSingular:!0,namePlural:!0,labelIdentifierFieldMetadataId:!0}}}}),i=n.edges.find(({node:e})=>e.nameSingular===t)?.node;if(!r(i))throw Error(`This workspace has no ${t} object.`);return i},re=async({objectNameSingular:e,recordId:r})=>{let i=new t.MetadataApiClient,a=await Z({metadataClient:i,objectNameSingular:e}),[o,s]=await Promise.all([Y({metadataClient:i,objectMetadata:a}),new n.RestApiClient().get(`/rest/${a.namePlural}/${r}`)]);return y({objectNameSingular:e,recordId:r,displayName:G(J({record:s.data[e],recordId:r,labelIdentifierField:o}))})},ie=y({objectNameSingular:v,recordId:v,displayName:`Ada`}),ae=async e=>{let{enqueueJob:n}=await new t.MetadataApiClient().mutation({enqueueJob:{__args:{input:e},enqueued:!0,logicFunctionUniversalIdentifier:!0,jobId:!0}});return n},
|
|
112
|
+
`,V=async({input:e,...t})=>{let{runAgent:n}=await h({query:B,variables:{input:r(e)?{...t,input:typeof e==`string`?[{role:`user`,content:e}]:e}:t},caller:`runAgent`});return n},ne=async e=>{let{sendInboxMessage:n}=await new t.MetadataApiClient().mutation({sendInboxMessage:{__args:{input:e},threadId:!0}});return n},H=/\[/g,U=/\]/g,W=/\r?\n/g,G=e=>e.replace(H,`(`).replace(U,`)`).replace(W,` `).trim(),K=async({workspaceMemberId:t})=>{let{data:{workspaceMember:r}}=await new n.RestApiClient().get(`/rest/workspaceMembers/${t}`),i=`${r.name.firstName??``} ${r.name.lastName??``}`.trim();return y({objectNameSingular:`workspaceMember`,recordId:t,displayName:G((0,e.isNonEmptyString)(i)?i:r.userEmail)})},q=({fullName:t,partName:n})=>{let r=(0,e.isObject)(t)?Reflect.get(t,n):void 0;return(0,e.isString)(r)?r:``},J=({record:e,recordId:t,labelIdentifierField:n})=>{if(!r(n))return t;let i=e[n.name];return n.type===`FULL_NAME`?`${q({fullName:i,partName:`firstName`})} ${q({fullName:i,partName:`lastName`})}`.trim():r(i)?String(i):``},Y=async({metadataClient:e,objectMetadata:t})=>{if(!r(t.labelIdentifierFieldMetadataId))return;let{object:n}=await e.query({object:{__args:{id:t.id},fields:{__args:{filter:{id:{eq:t.labelIdentifierFieldMetadataId}},paging:{first:1}},edges:{node:{name:!0,type:!0}}}}});return n.fields.edges[0]?.node},X=1e3,Z=async({metadataClient:e,objectNameSingular:t})=>{let{objects:n}=await e.query({objects:{__args:{filter:{},paging:{first:X}},edges:{node:{id:!0,nameSingular:!0,namePlural:!0,labelIdentifierFieldMetadataId:!0}}}}),i=n.edges.find(({node:e})=>e.nameSingular===t)?.node;if(!r(i))throw Error(`This workspace has no ${t} object.`);return i},re=async({objectNameSingular:e,recordId:r})=>{let i=new t.MetadataApiClient,a=await Z({metadataClient:i,objectNameSingular:e}),[o,s]=await Promise.all([Y({metadataClient:i,objectMetadata:a}),new n.RestApiClient().get(`/rest/${a.namePlural}/${r}`)]);return y({objectNameSingular:e,recordId:r,displayName:G(J({record:s.data[e],recordId:r,labelIdentifierField:o}))})},ie=y({objectNameSingular:v,recordId:v,displayName:`Ada`}),ae=async e=>{await new t.MetadataApiClient().mutation({attachRecordToInboxThread:{__args:{input:e}}})},oe=async e=>{await new t.MetadataApiClient().mutation({detachRecordFromInboxThread:{__args:{input:e}}})},se=async e=>{let{enqueueJob:n}=await new t.MetadataApiClient().mutation({enqueueJob:{__args:{input:e},enqueued:!0,logicFunctionUniversalIdentifier:!0,jobId:!0}});return n},Q=async e=>{let{enqueueJobs:n}=await new t.MetadataApiClient().mutation({enqueueJobs:{__args:{input:e},enqueued:!0,logicFunctionUniversalIdentifier:!0,enqueuedJobsCount:!0,jobIds:!0}});return n},ce=async e=>{let{getJobs:n}=await new t.MetadataApiClient().query({getJobs:{__args:{jobIds:e},jobId:!0,state:!0,attemptsMade:!0,failedReason:!0,enqueuedAt:!0,startedAt:!0,finishedAt:!0}});return n},le=e=>({__args:{paging:{first:e.length},filter:{universalIdentifier:{in:e}}},edges:{node:{id:!0,universalIdentifier:!0,nameSingular:!0}}}),ue=async({timelineActivityTypeUniversalIdentifier:e,targetObjectUniversalIdentifier:i,linkedObjectMetadataUniversalIdentifier:a,targetRecordId:o,...s})=>{let c=[...new Set([i,a].filter(r))],{timelineActivityTypes:l,objects:u}=await new t.MetadataApiClient().query({timelineActivityTypes:{id:!0,universalIdentifier:!0,isActive:!0},objects:le(c)}),d=l.find(({universalIdentifier:t})=>t===e);if(!r(d))throw Error(`Timeline activity type ${e} is not installed`);if(!d.isActive)throw Error(`Timeline activity type ${e} is inactive`);let f=new Map(u.edges.map(({node:e})=>[e.universalIdentifier,e])),p=f.get(i);if(!r(p))throw Error(`Timeline activity target object ${i} is not installed`);let m=`target${b(p.nameSingular)}Id`,h=r(a)?f.get(a):void 0;if(r(a)&&!r(h))throw Error(`Timeline activity linked object ${a} is not installed`);return(await new n.RestApiClient().post(`/rest/timelineActivities`,{...s,timelineActivityTypeId:d.id,linkedObjectMetadataId:h?.id,[m]:o})).data.createTimelineActivity},de=`
|
|
113
113
|
query GetAppKeyValue($key: String!, $scope: AppKeyValueScope) {
|
|
114
114
|
appKeyValue(key: $key, scope: $scope) {
|
|
115
115
|
key
|
|
@@ -117,7 +117,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
|
|
|
117
117
|
scope
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
`,
|
|
120
|
+
`,fe=`
|
|
121
121
|
mutation SetAppKeyValue($input: SetAppKeyValueInput!) {
|
|
122
122
|
setAppKeyValue(input: $input) {
|
|
123
123
|
key
|
|
@@ -125,9 +125,9 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
|
|
|
125
125
|
scope
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
`,
|
|
128
|
+
`,pe=`
|
|
129
129
|
mutation DeleteAppKeyValue($key: String!, $scope: AppKeyValueScope) {
|
|
130
130
|
deleteAppKeyValue(key: $key, scope: $scope)
|
|
131
131
|
}
|
|
132
|
-
`,$=`WORKSPACE`,
|
|
132
|
+
`,$=`WORKSPACE`,me={async get(e,t){let{appKeyValue:n}=await h({query:de,variables:{key:e,scope:t?.scope??$},caller:`kv.get`});return n?.value??null},async set(e,t,n){await h({query:fe,variables:{input:{key:e,value:t,scope:n?.scope??$}},caller:`kv.set`})},async delete(e,t){let{deleteAppKeyValue:n}=await h({query:pe,variables:{key:e,scope:t?.scope??$},caller:`kv.delete`});return n}},he=class{constructor(e,t){this.__twentyHttpResponse=!0,this.body=e,this.status=t?.status,this.headers=t?.headers}};exports.AppConnectionAuthFailedError=c,exports.INBOX_ASSISTANT_MENTION=ie,exports.Response=he,exports.RetryableLogicFunctionError=s,exports.attachRecordToInboxThread=ae,exports.createMessageChannel=E,exports.createTimelineActivity=ue,exports.deleteMessageChannel=M,exports.detachRecordFromInboxThread=oe,exports.enqueueJob=se,exports.enqueueJobs=Q,exports.findConnectionForRequest=te,exports.getConnection=_,exports.getJobs=ce,exports.inboxMention=K,exports.inboxReferenceRecord=re,exports.ingestMessages=P,exports.jsonSchemaToInputSchema=a,exports.kv=me,exports.listConnections=ee,exports.listMessageChannels=O,exports.listMessageFolders=L,exports.reportConnectionAuthFailure=C,exports.runAgent=V,exports.sendInboxMessage=ne,exports.syncMessageFolders=z,exports.updateMessageChannel=A;
|
|
133
133
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["n","e","n","e"],"sources":["../../../twenty-shared/dist/isDefined-Dtu5EYqP.mjs","../../../twenty-shared/dist/logic-function.mjs","../../src/sdk/logic-function/connections/errors/app-connection-auth-failed.error.ts","../../../twenty-shared/dist/application-runtime.mjs","../../src/sdk/logic-function/connections/utils/with-legacy-connection-visibility.util.ts","../../src/sdk/utils/get-application-access-token.ts","../../src/sdk/logic-function/utils/post-graphql-request.util.ts","../../src/sdk/logic-function/connections/get-connection.ts","../../../twenty-shared/dist/get-ai-model-tier-from-model-id.util-C26DZ9rM.mjs","../../../twenty-shared/dist/capitalize-DFPVt1IM.mjs","../../src/sdk/logic-function/connections/list-connections.ts","../../src/sdk/logic-function/connections/find-connection-for-request.ts","../../src/sdk/logic-function/connections/report-connection-auth-failure.ts","../../src/sdk/logic-function/messaging/message-channel-fields.constant.ts","../../src/sdk/logic-function/messaging/create-message-channel.ts","../../src/sdk/logic-function/messaging/list-message-channels.ts","../../src/sdk/logic-function/messaging/update-message-channel.ts","../../src/sdk/logic-function/messaging/delete-message-channel.ts","../../src/sdk/logic-function/messaging/ingest-messages.ts","../../src/sdk/logic-function/messaging/message-folder-fields.constant.ts","../../src/sdk/logic-function/messaging/list-message-folders.ts","../../src/sdk/logic-function/messaging/sync-message-folders.ts","../../src/sdk/logic-function/agents/run-agent.ts","../../src/sdk/inbox/send-inbox-message.ts","../../src/sdk/inbox/mentions/utils/sanitize-inbox-reference-label.util.ts","../../src/sdk/inbox/mentions/inbox-mention.ts","../../src/sdk/inbox/mentions/utils/compute-inbox-record-label.util.ts","../../src/sdk/inbox/mentions/utils/find-inbox-label-identifier-field.util.ts","../../src/sdk/inbox/mentions/utils/find-inbox-object-metadata-or-throw.util.ts","../../src/sdk/inbox/mentions/inbox-reference-record.ts","../../src/sdk/inbox/mentions/inbox-assistant-mention.ts","../../src/sdk/logic-function/jobs/enqueue-job.ts","../../src/sdk/logic-function/jobs/enqueue-jobs.ts","../../src/sdk/logic-function/jobs/get-jobs.ts","../../src/sdk/logic-function/timeline/create-timeline-activity.ts","../../src/sdk/logic-function/key-value/kv.ts","../../src/sdk/logic-function/response.ts"],"sourcesContent":["import { isNull as e, isUndefined as t } from \"@sniptt/guards\";\n//#region src/utils/validation/isDefined.ts\nvar n = (n) => !t(n) && !e(n);\n//#endregion\nexport { n as t };\n","import { t as e } from \"./isDefined-Dtu5EYqP.mjs\";\nimport { t } from \"./is-record-object-schema-CwzshFdt.mjs\";\nimport { isNonEmptyString as n, isObject as r } from \"@sniptt/guards\";\n//#region src/logic-function/build-tool-input-json-schema.ts\nvar i = (e, t) => {\n\tlet r = n(e) ? t?.(e) : void 0;\n\treturn `Id of the ${n(r) ? r : \"linked\"} record`;\n}, a = (n, o) => {\n\tif (t(n)) return {\n\t\ttype: \"string\",\n\t\tdescription: i(n.objectUniversalIdentifier, o)\n\t};\n\tif (n.type === \"records\") return {\n\t\ttype: \"array\",\n\t\titems: {\n\t\t\ttype: \"string\",\n\t\t\tdescription: i(n.objectUniversalIdentifier, o)\n\t\t}\n\t};\n\tlet { objectUniversalIdentifier: s, multiline: c, label: l, items: u, properties: d, additionalProperties: f, ...p } = n, m = { ...p };\n\treturn e(u) && (m.items = a(u, o)), e(d) && (m.properties = Object.fromEntries(Object.entries(d).map(([e, t]) => [e, a(t, o)]))), e(f) && (m.additionalProperties = r(f) ? a(f, o) : f), m;\n}, o = {\n\ttype: \"object\",\n\tproperties: {}\n}, s = (e) => {\n\tlet t = { type: \"unknown\" };\n\tswitch (e.type) {\n\t\tcase \"string\":\n\t\t\tt.type = \"string\";\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\tcase \"integer\":\n\t\t\tt.type = \"number\";\n\t\t\tbreak;\n\t\tcase \"boolean\":\n\t\t\tt.type = \"boolean\";\n\t\t\tbreak;\n\t\tcase \"array\":\n\t\t\tt.type = \"array\", e.items && (t.items = s(e.items));\n\t\t\tbreak;\n\t\tcase \"object\":\n\t\t\tt.type = \"object\", e.properties && (t.properties = Object.fromEntries(Object.entries(e.properties).map(([e, t]) => [e, s(t)])));\n\t\t\tbreak;\n\t\tcase \"record\":\n\t\t\tt.type = \"record\";\n\t\t\tbreak;\n\t\tcase \"records\":\n\t\t\tt.type = \"records\";\n\t\t\tbreak;\n\t\tdefault: t.type = \"unknown\";\n\t}\n\treturn Array.isArray(e.enum) && (t.enum = e.enum.filter((e) => typeof e == \"string\")), e.multiline === !0 && (t.multiline = !0), n(e.label) && (t.label = e.label), n(e.objectUniversalIdentifier) && (t.objectUniversalIdentifier = e.objectUniversalIdentifier), t;\n}, c = (e) => [s(e)], l = { inputSchema: c({\n\ttype: \"object\",\n\tproperties: {\n\t\ta: { type: \"string\" },\n\t\tb: { type: \"number\" }\n\t}\n}) }, u = async (t) => {\n\tlet { getFunctionInputSchema: n } = await import(\"./get-function-input-schema-GNk3NRLJ.mjs\"), r = n(t)[0];\n\treturn r?.type === \"object\" && e(r.properties) ? {\n\t\ttype: \"object\",\n\t\tproperties: r.properties\n\t} : o;\n}, d = (t) => !e(t) || t === null ? \"unknown\" : typeof t == \"string\" ? \"string\" : typeof t == \"number\" ? \"number\" : typeof t == \"boolean\" ? \"boolean\" : Array.isArray(t) ? \"array\" : \"unknown\", f = (e) => e ? Object.entries(e).reduce((e, [t, n]) => (r(n) && !Array.isArray(n) ? e[t] = {\n\tisLeaf: !1,\n\ttype: \"object\",\n\tlabel: t,\n\tvalue: f(n)\n} : e[t] = {\n\tisLeaf: !0,\n\tvalue: n,\n\ttype: d(n),\n\tlabel: t\n}, e), {}) : {}, p = (e, t) => e ? `${e}.${t}` : t, m = (t, n, r = \"\") => {\n\tlet i = [];\n\tfor (let [a, o] of Object.entries(n)) {\n\t\tlet n = p(r, a), s = t[a];\n\t\tif (!e(s)) {\n\t\t\ti.push(`Missing key \"${n}\" in declared output schema.`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (o.isLeaf !== s.isLeaf) {\n\t\t\ti.push(`Type mismatch at \"${n}\": expected ${o.isLeaf ? o.type : \"object\"} but declared ${s.isLeaf ? s.type : \"object\"}.`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!o.isLeaf && !s.isLeaf) {\n\t\t\ti.push(...m(s.value, o.value, n));\n\t\t\tcontinue;\n\t\t}\n\t\to.isLeaf && s.isLeaf && o.type !== \"unknown\" && s.type !== \"unknown\" && o.type !== s.type && i.push(`Type mismatch at \"${n}\": expected ${o.type} but declared ${s.type}.`);\n\t}\n\treturn i;\n}, h = [\n\t\"string\",\n\t\"number\",\n\t\"boolean\",\n\t\"array\",\n\t\"unknown\"\n], g = (e) => h.includes(e), _ = (e, t) => {\n\tlet n = t.label ?? e;\n\treturn t.type === \"record\" ? {\n\t\tisLeaf: !0,\n\t\ttype: \"string\",\n\t\tlabel: n,\n\t\tvalue: null\n\t} : t.type === \"records\" ? {\n\t\tisLeaf: !0,\n\t\ttype: \"array\",\n\t\tlabel: n,\n\t\tvalue: null\n\t} : t.type === \"object\" ? {\n\t\tisLeaf: !1,\n\t\ttype: \"object\",\n\t\tlabel: n,\n\t\tvalue: r(t.properties) ? v(t.properties) : {}\n\t} : {\n\t\tisLeaf: !0,\n\t\ttype: g(t.type) ? t.type : \"unknown\",\n\t\tlabel: n,\n\t\tvalue: null\n\t};\n}, v = (e) => Object.entries(e).reduce((e, [t, n]) => (e[t] = _(t, n), e), {}), y = (e) => {\n\tlet t = e[0];\n\treturn t?.type !== \"object\" || !r(t.properties) ? {} : v(t.properties);\n}, b = (e) => e?.type === \"records\" && n(e.objectUniversalIdentifier) || e?.type === \"array\" && t(e?.items), x = \"RetryableLogicFunctionError\", S = class extends Error {\n\tconstructor(e) {\n\t\tsuper(e), this.name = x;\n\t}\n};\n//#endregion\nexport { o as DEFAULT_TOOL_INPUT_SCHEMA, x as RETRYABLE_LOGIC_FUNCTION_ERROR_NAME, S as RetryableLogicFunctionError, l as SEED_WORKFLOW_ACTION_TRIGGER_SETTINGS, a as buildToolInputJsonSchema, u as getInputSchemaFromSourceCode, f as getOutputSchemaFromValue, m as getOutputSchemaMismatchIssues, y as inputSchemaToOutputSchema, b as isRecordArraySchema, t as isRecordObjectSchema, c as jsonSchemaToInputSchema };\n","// Thrown when the platform asks the SDK to operate on a connection whose\n// OAuth refresh failed permanently (`authFailedAt` is set). The end user\n// must reconnect from the app's settings tab — the app cannot recover on\n// its own.\n//\n// `listConnections` filters these out by default (the user can't act on\n// them anyway). `getConnection` throws this when the looked-up connection\n// is in this state, so a stored connection id can be safely retried until\n// it works again.\nexport class AppConnectionAuthFailedError extends Error {\n readonly connectionId: string;\n\n constructor(connectionId: string) {\n super(\n `App connection ${connectionId} requires the user to reconnect ` +\n `(authFailedAt is set). Surface a \"Reconnect\" prompt in your UI.`,\n );\n this.name = 'AppConnectionAuthFailedError';\n this.connectionId = connectionId;\n }\n}\n","//#region src/application-runtime/constants/ConnectionScopeByLegacyVisibility.ts\nvar e = {\n\tuser: \"USER\",\n\tworkspace: \"WORKSPACE\"\n}, t = \"TWENTY_API_KEY\", n = \"TWENTY_API_URL\", r = \"TWENTY_APP_ACCESS_TOKEN\", i = \"TWENTY_APP_APPLICATION_ACCESS_TOKEN\", a = \"TWENTY_FUNCTIONS_URL\", o = {\n\tUSER: \"user\",\n\tWORKSPACE: \"workspace\"\n}, s = [\n\t\"workspace-suspended\",\n\t\"no-subscription\",\n\t\"no-credits\"\n];\n//#endregion\nexport { e as CONNECTION_SCOPE_BY_LEGACY_VISIBILITY, s as CREDIT_UNAVAILABLE_REASONS, t as DEFAULT_API_KEY_NAME, n as DEFAULT_API_URL_NAME, r as DEFAULT_APP_ACCESS_TOKEN_NAME, i as DEFAULT_APP_APPLICATION_ACCESS_TOKEN_NAME, a as DEFAULT_FUNCTIONS_URL_NAME, o as LEGACY_CONNECTION_VISIBILITY_BY_SCOPE };\n","import { LEGACY_CONNECTION_VISIBILITY_BY_SCOPE } from 'twenty-shared/application-runtime';\n\nimport { type AppConnection } from '@/sdk/logic-function/connections/types/app-connection.type';\n\ntype WithoutVisibility<TConnection> = TConnection extends unknown\n ? Omit<TConnection, 'visibility'>\n : never;\n\nexport type AppConnectionWithoutVisibility = WithoutVisibility<AppConnection>;\n\nexport const withLegacyConnectionVisibility = (\n connection: AppConnectionWithoutVisibility,\n): AppConnection => ({\n ...connection,\n visibility: LEGACY_CONNECTION_VISIBILITY_BY_SCOPE[connection.scope],\n});\n","import {\n DEFAULT_APP_ACCESS_TOKEN_NAME,\n DEFAULT_APP_APPLICATION_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application-runtime';\n\n// These reach the application's own resources, so prefer the application token when the runtime injects one\nexport const getApplicationAccessToken = (): string | undefined =>\n process.env[DEFAULT_APP_APPLICATION_ACCESS_TOKEN_NAME] ??\n process.env[DEFAULT_APP_ACCESS_TOKEN_NAME];\n","import {\n DEFAULT_API_URL_NAME,\n DEFAULT_APP_APPLICATION_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application-runtime';\n\nimport { getApplicationAccessToken } from '@/sdk/utils/get-application-access-token';\n\nexport const postGraphqlRequest = async <TVariables, TData>({\n query,\n variables,\n caller,\n}: {\n query: string;\n variables: TVariables;\n caller: string;\n}): Promise<TData> => {\n const apiUrl = process.env[DEFAULT_API_URL_NAME];\n const accessToken = getApplicationAccessToken();\n\n if (!apiUrl || !accessToken) {\n throw new Error(\n `${caller}() requires the app runtime env vars ` +\n `${DEFAULT_API_URL_NAME} and ${DEFAULT_APP_APPLICATION_ACCESS_TOKEN_NAME}.`,\n );\n }\n\n const response = await fetch(`${apiUrl}/metadata`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${accessToken}`,\n },\n body: JSON.stringify({ query, variables }),\n });\n\n if (!response.ok) {\n throw new Error(\n `${caller}() failed: HTTP ${response.status} ${response.statusText}`,\n );\n }\n\n const body = (await response.json()) as {\n data?: TData;\n errors?: { message: string }[];\n };\n\n if (body.errors && body.errors.length > 0) {\n throw new Error(\n `${caller}() failed: ${body.errors.map((error) => error.message).join(', ')}`,\n );\n }\n\n if (!body.data) {\n throw new Error(`${caller}() failed: response contained no data.`);\n }\n\n return body.data;\n};\n","import { AppConnectionAuthFailedError } from '@/sdk/logic-function/connections/errors/app-connection-auth-failed.error';\nimport { type AppConnection } from '@/sdk/logic-function/connections/types/app-connection.type';\nimport {\n type AppConnectionWithoutVisibility,\n withLegacyConnectionVisibility,\n} from '@/sdk/logic-function/connections/utils/with-legacy-connection-visibility.util';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst GET_APP_CONNECTION_QUERY = `\n query GetAppConnection($id: ID!) {\n appConnection(id: $id) {\n id\n providerName\n name\n handle\n externalAccountId\n scope\n userWorkspaceId\n workspaceMemberId\n providerType\n accessToken\n scopes\n authFailedAt\n authFailedReason\n }\n }\n`;\n\nexport const getConnection = async (id: string): Promise<AppConnection> => {\n const { appConnection } = await postGraphqlRequest<\n { id: string },\n { appConnection: AppConnectionWithoutVisibility }\n >({\n query: GET_APP_CONNECTION_QUERY,\n variables: { id },\n caller: 'getConnection',\n });\n\n if (appConnection.authFailedAt !== null) {\n throw new AppConnectionAuthFailedError(appConnection.id);\n }\n\n return withLegacyConnectionVisibility(appConnection);\n};\n","//#region src/ai/constants/agent-chat-assistant-mention-object-name-singular.const.ts\nvar e = \"agentChatAssistant\", t = [\n\t\"extraFast\",\n\t\"fast\",\n\t\"balanced\",\n\t\"smart\",\n\t\"extraSmart\"\n], n = {\n\textraFast: \"default-extra-fast-model\",\n\tfast: \"default-fast-model\",\n\tbalanced: \"default-balanced-model\",\n\tsmart: \"default-smart-model\",\n\textraSmart: \"default-extra-smart-model\"\n}, r = \"workspace-default-model\", i = (e) => /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e), a = ({ objectNameSingular: e, recordId: t, displayName: n }) => e === \"agentChatAssistant\" ? `@${n}` : `[[record:${e}:${t}:${n}]]`, o = ({ skillId: e, label: t }) => `[[skill:${e}:${t}]]`, s = (e) => t.find((t) => n[t] === e);\n//#endregion\nexport { r as a, e as c, i, o as n, n as o, a as r, t as s, s as t };\n","import { isNonEmptyString as e } from \"@sniptt/guards\";\n//#region src/i18n/do-not-translate.ts\nvar t = (e) => e, n = (t) => e(t) ? t.charAt(0).toUpperCase() + t.slice(1) : \"\";\n//#endregion\nexport { t as n, n as t };\n","import { CONNECTION_SCOPE_BY_LEGACY_VISIBILITY } from 'twenty-shared/application-runtime';\nimport { isDefined } from 'twenty-shared/utils';\n\nimport { type AppConnection } from '@/sdk/logic-function/connections/types/app-connection.type';\nimport {\n type AppConnectionWithoutVisibility,\n withLegacyConnectionVisibility,\n} from '@/sdk/logic-function/connections/utils/with-legacy-connection-visibility.util';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst LIST_APP_CONNECTIONS_QUERY = `\n query ListAppConnections($filter: ListAppConnectionsInput) {\n appConnections(filter: $filter) {\n id\n providerName\n name\n handle\n externalAccountId\n scope\n userWorkspaceId\n workspaceMemberId\n providerType\n accessToken\n scopes\n authFailedAt\n authFailedReason\n }\n }\n`;\n\nexport type ListConnectionsFilter = {\n providerName?: string;\n userWorkspaceId?: string;\n scope?: AppConnection['scope'];\n /** @deprecated Use `scope` instead. */\n visibility?: AppConnection['visibility'];\n};\n\nexport const listConnections = async ({\n visibility,\n ...filter\n}: ListConnectionsFilter = {}): Promise<AppConnection[]> => {\n const { appConnections } = await postGraphqlRequest<\n { filter: Omit<ListConnectionsFilter, 'visibility'> },\n { appConnections: AppConnectionWithoutVisibility[] }\n >({\n query: LIST_APP_CONNECTIONS_QUERY,\n variables: {\n filter: {\n ...filter,\n scope:\n filter.scope ??\n (isDefined(visibility)\n ? CONNECTION_SCOPE_BY_LEGACY_VISIBILITY[visibility]\n : undefined),\n },\n },\n caller: 'listConnections',\n });\n\n return appConnections.map(withLegacyConnectionVisibility);\n};\n","import { type AppConnection } from '@/sdk/logic-function/connections/types/app-connection.type';\n\nexport const findConnectionForRequest = (\n connections: AppConnection[],\n event: { userWorkspaceId: string | null },\n): AppConnection | null => {\n if (event.userWorkspaceId !== null) {\n const personal = connections.find(\n (connection) =>\n connection.scope === 'USER' &&\n connection.userWorkspaceId === event.userWorkspaceId,\n );\n\n if (personal) {\n return personal;\n }\n }\n\n const workspaceShared = connections.find(\n (connection) => connection.scope === 'WORKSPACE',\n );\n\n return workspaceShared ?? null;\n};\n","import { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst REPORT_APP_CONNECTION_AUTH_FAILURE_MUTATION = `\n mutation ReportAppConnectionAuthFailure($input: ReportAppConnectionAuthFailureInput!) {\n reportAppConnectionAuthFailure(input: $input)\n }\n`;\n\nexport const reportConnectionAuthFailure = async ({\n connectionId,\n reason,\n}: {\n connectionId: string;\n reason?: string;\n}): Promise<void> => {\n await postGraphqlRequest<\n { input: { id: string; reason?: string } },\n { reportAppConnectionAuthFailure: boolean }\n >({\n query: REPORT_APP_CONNECTION_AUTH_FAILURE_MUTATION,\n variables: { input: { id: connectionId, reason } },\n caller: 'reportConnectionAuthFailure',\n });\n};\n","// Shared by every helper, so channels returned by any of them are interchangeable\nexport const APP_MESSAGE_CHANNEL_SELECTION = `\n id\n handle\n displayName\n visibility\n connectedAccountId\n isSyncEnabled\n participantHandleFieldUniversalIdentifier\n messagingProviderUniversalIdentifier\n`;\n","import { type MessageChannelVisibility } from '@/sdk/define/common/types/loose-shared-types.type';\nimport { APP_MESSAGE_CHANNEL_SELECTION } from '@/sdk/logic-function/messaging/message-channel-fields.constant';\nimport { type AppMessageChannel } from '@/sdk/logic-function/messaging/types/app-message-channel.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst CREATE_APP_MESSAGE_CHANNEL_MUTATION = `\n mutation CreateAppMessageChannel($input: CreateAppMessageChannelInput!) {\n createAppMessageChannel(input: $input) {\n ${APP_MESSAGE_CHANNEL_SELECTION}\n }\n }\n`;\n\nexport type CreateMessageChannelInput = {\n // An app connection id (from getConnection/listConnections); the channel speaks through it and inherits who may see it\n connectedAccountId: string;\n // The account's provider identity; inbound participants matching it are treated as the account itself\n handle: string;\n displayName?: string;\n // Required: decides whether one member's conversations are readable by the whole workspace, and only the app\n // knows how private its messages are ('METADATA' for personal inboxes, 'SHARE_EVERYTHING' for shared ones)\n visibility: MessageChannelVisibility;\n // Person field to match participant handles against (handles are then stored in its canonical form); set once\n participantHandleFieldUniversalIdentifier?: string;\n messagingProvider?: { universalIdentifier: string };\n};\n\nexport const createMessageChannel = async ({\n messagingProvider,\n ...input\n}: CreateMessageChannelInput): Promise<AppMessageChannel> => {\n const { createAppMessageChannel } = await postGraphqlRequest<\n {\n input: Omit<CreateMessageChannelInput, 'messagingProvider'> & {\n messagingProviderUniversalIdentifier?: string;\n };\n },\n { createAppMessageChannel: AppMessageChannel }\n >({\n query: CREATE_APP_MESSAGE_CHANNEL_MUTATION,\n variables: {\n input: {\n ...input,\n messagingProviderUniversalIdentifier:\n messagingProvider?.universalIdentifier,\n },\n },\n caller: 'createMessageChannel',\n });\n\n return createAppMessageChannel;\n};\n","import { APP_MESSAGE_CHANNEL_SELECTION } from '@/sdk/logic-function/messaging/message-channel-fields.constant';\nimport { type AppMessageChannel } from '@/sdk/logic-function/messaging/types/app-message-channel.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst LIST_APP_MESSAGE_CHANNELS_QUERY = `\n query ListAppMessageChannels($filter: ListAppMessageChannelsInput) {\n appMessageChannels(filter: $filter) {\n ${APP_MESSAGE_CHANNEL_SELECTION}\n }\n }\n`;\n\nexport type ListMessageChannelsFilter = {\n connectedAccountId?: string;\n};\n\nexport const listMessageChannels = async (\n filter: ListMessageChannelsFilter = {},\n): Promise<AppMessageChannel[]> => {\n const { appMessageChannels } = await postGraphqlRequest<\n { filter: ListMessageChannelsFilter },\n { appMessageChannels: AppMessageChannel[] }\n >({\n query: LIST_APP_MESSAGE_CHANNELS_QUERY,\n variables: { filter },\n caller: 'listMessageChannels',\n });\n\n return appMessageChannels;\n};\n","import { type MessageChannelVisibility } from '@/sdk/define/common/types/loose-shared-types.type';\nimport { APP_MESSAGE_CHANNEL_SELECTION } from '@/sdk/logic-function/messaging/message-channel-fields.constant';\nimport { type AppMessageChannel } from '@/sdk/logic-function/messaging/types/app-message-channel.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst UPDATE_APP_MESSAGE_CHANNEL_MUTATION = `\n mutation UpdateAppMessageChannel($input: UpdateAppMessageChannelInput!) {\n updateAppMessageChannel(input: $input) {\n ${APP_MESSAGE_CHANNEL_SELECTION}\n }\n }\n`;\n\nexport type UpdateMessageChannelInput = {\n id: string;\n // Omitted leaves the current label untouched; null clears it.\n displayName?: string | null;\n // Changes who can read every message already ingested, not just the ones that follow\n visibility?: MessageChannelVisibility;\n // False pauses ingestion (further ingests are rejected) without deleting the history\n isSyncEnabled?: boolean;\n messagingProvider?: { universalIdentifier: string } | null;\n};\n\nexport const updateMessageChannel = async ({\n messagingProvider,\n ...input\n}: UpdateMessageChannelInput): Promise<AppMessageChannel> => {\n const { updateAppMessageChannel } = await postGraphqlRequest<\n {\n input: Omit<UpdateMessageChannelInput, 'messagingProvider'> & {\n messagingProviderUniversalIdentifier?: string | null;\n };\n },\n { updateAppMessageChannel: AppMessageChannel }\n >({\n query: UPDATE_APP_MESSAGE_CHANNEL_MUTATION,\n variables: {\n input: {\n ...input,\n messagingProviderUniversalIdentifier:\n messagingProvider === undefined\n ? undefined\n : (messagingProvider?.universalIdentifier ?? null),\n },\n },\n caller: 'updateMessageChannel',\n });\n\n return updateAppMessageChannel;\n};\n","import { APP_MESSAGE_CHANNEL_SELECTION } from '@/sdk/logic-function/messaging/message-channel-fields.constant';\nimport { type AppMessageChannel } from '@/sdk/logic-function/messaging/types/app-message-channel.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst DELETE_APP_MESSAGE_CHANNEL_MUTATION = `\n mutation DeleteAppMessageChannel($id: UUID!) {\n deleteAppMessageChannel(id: $id) {\n ${APP_MESSAGE_CHANNEL_SELECTION}\n }\n }\n`;\n\n// Also deletes the channel's ingested messages and emptied threads; call from onDisconnect to retire a channel with its credential.\n// To stop ingesting but keep the history, set `isSyncEnabled` to false instead.\nexport const deleteMessageChannel = async (\n id: string,\n): Promise<AppMessageChannel> => {\n const { deleteAppMessageChannel } = await postGraphqlRequest<\n { id: string },\n { deleteAppMessageChannel: AppMessageChannel }\n >({\n query: DELETE_APP_MESSAGE_CHANNEL_MUTATION,\n variables: { id },\n caller: 'deleteMessageChannel',\n });\n\n return deleteAppMessageChannel;\n};\n","import {\n type IngestMessage,\n type IngestedMessage,\n} from '@/sdk/logic-function/messaging/types/ingest-message.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst INGEST_APP_MESSAGES_MUTATION = `\n mutation IngestAppMessages($input: IngestAppMessagesInput!) {\n ingestAppMessages(input: $input) {\n messages {\n externalId\n messageId\n messageThreadId\n }\n }\n }\n`;\n\n// Threading, dedup and privacy are handled server-side. At most 100 messages per call (one transaction\n// within one logic-function timeout), so page provider backfills\nexport const ingestMessages = async ({\n messageChannelId,\n messages,\n}: {\n messageChannelId: string;\n messages: IngestMessage[];\n}): Promise<IngestedMessage[]> => {\n const { ingestAppMessages } = await postGraphqlRequest<\n { input: { messageChannelId: string; messages: IngestMessage[] } },\n { ingestAppMessages: { messages: IngestedMessage[] } }\n >({\n query: INGEST_APP_MESSAGES_MUTATION,\n variables: { input: { messageChannelId, messages } },\n caller: 'ingestMessages',\n });\n\n return ingestAppMessages.messages;\n};\n","export const APP_MESSAGE_FOLDER_SELECTION = `\n id\n externalId\n name\n isSynced\n messageChannelId\n`;\n","import { APP_MESSAGE_FOLDER_SELECTION } from '@/sdk/logic-function/messaging/message-folder-fields.constant';\nimport { type AppMessageFolder } from '@/sdk/logic-function/messaging/types/app-message-folder.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst LIST_APP_MESSAGE_FOLDERS_QUERY = `\n query ListAppMessageFolders($filter: ListAppMessageFoldersInput) {\n appMessageFolders(filter: $filter) {\n ${APP_MESSAGE_FOLDER_SELECTION}\n }\n }\n`;\n\nexport type ListMessageFoldersFilter = {\n messageChannelId?: string;\n};\n\nexport const listMessageFolders = async (\n filter: ListMessageFoldersFilter = {},\n): Promise<AppMessageFolder[]> => {\n const { appMessageFolders } = await postGraphqlRequest<\n { filter: ListMessageFoldersFilter },\n { appMessageFolders: AppMessageFolder[] }\n >({\n query: LIST_APP_MESSAGE_FOLDERS_QUERY,\n variables: { filter },\n caller: 'listMessageFolders',\n });\n\n return appMessageFolders;\n};\n","import { APP_MESSAGE_FOLDER_SELECTION } from '@/sdk/logic-function/messaging/message-folder-fields.constant';\nimport { type AppMessageFolder } from '@/sdk/logic-function/messaging/types/app-message-folder.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst SYNC_APP_MESSAGE_FOLDERS_MUTATION = `\n mutation SyncAppMessageFolders($input: SyncAppMessageFoldersInput!) {\n syncAppMessageFolders(input: $input) {\n ${APP_MESSAGE_FOLDER_SELECTION}\n }\n }\n`;\n\nexport type SyncMessageFoldersInput = {\n messageChannelId: string;\n folders: {\n externalId: string;\n name: string;\n isSynced?: boolean;\n }[];\n};\n\nexport const syncMessageFolders = async (\n input: SyncMessageFoldersInput,\n): Promise<AppMessageFolder[]> => {\n const { syncAppMessageFolders } = await postGraphqlRequest<\n { input: SyncMessageFoldersInput },\n { syncAppMessageFolders: AppMessageFolder[] }\n >({\n query: SYNC_APP_MESSAGE_FOLDERS_MUTATION,\n variables: { input },\n caller: 'syncMessageFolders',\n });\n\n return syncAppMessageFolders;\n};\n","import {\n type RunAgentInput,\n type RunAgentResult,\n} from 'twenty-shared/application';\nimport { isDefined } from 'twenty-shared/utils';\n\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst RUN_AGENT_MUTATION = `\n mutation RunAgent($input: RunAgentInput!) {\n runAgent(input: $input) {\n threadId\n status\n result\n error\n success\n }\n }\n`;\n\nexport const runAgent = async ({\n input,\n ...rest\n}: RunAgentInput): Promise<RunAgentResult> => {\n const variables = {\n input: isDefined(input)\n ? {\n ...rest,\n input:\n typeof input === 'string'\n ? [{ role: 'user', content: input }]\n : input,\n }\n : rest,\n };\n\n const { runAgent: result } = await postGraphqlRequest<\n typeof variables,\n { runAgent: RunAgentResult }\n >({\n query: RUN_AGENT_MUTATION,\n variables,\n caller: 'runAgent',\n });\n\n return result;\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { type SendInboxMessageResult } from 'twenty-shared/application';\n\nimport { type SendInboxMessageInput } from '@/sdk/define/common/types/loose-shared-types.type';\n\nexport const sendInboxMessage = async (\n input: SendInboxMessageInput,\n): Promise<SendInboxMessageResult> => {\n const client = new MetadataApiClient();\n\n const { sendInboxMessage: result } = await client.mutation({\n sendInboxMessage: {\n __args: { input },\n threadId: true,\n },\n });\n\n return result;\n};\n","const OPENING_BRACKET_PATTERN = /\\[/g;\nconst CLOSING_BRACKET_PATTERN = /\\]/g;\nconst LINE_BREAK_PATTERN = /\\r?\\n/g;\n\nexport const sanitizeInboxReferenceLabel = (label: string): string =>\n label\n .replace(OPENING_BRACKET_PATTERN, '(')\n .replace(CLOSING_BRACKET_PATTERN, ')')\n .replace(LINE_BREAK_PATTERN, ' ')\n .trim();\n","import { isNonEmptyString } from '@sniptt/guards';\nimport { RestApiClient } from 'twenty-client-sdk/rest';\nimport { formatRecordReference } from 'twenty-shared/ai';\n\nimport { sanitizeInboxReferenceLabel } from '@/sdk/inbox/mentions/utils/sanitize-inbox-reference-label.util';\n\ntype WorkspaceMemberResponse = {\n data: {\n workspaceMember: {\n name: { firstName: string | null; lastName: string | null };\n userEmail: string;\n };\n };\n};\n\nexport const inboxMention = async ({\n workspaceMemberId,\n}: {\n workspaceMemberId: string;\n}): Promise<string> => {\n const {\n data: { workspaceMember },\n } = await new RestApiClient().get<WorkspaceMemberResponse>(\n `/rest/workspaceMembers/${workspaceMemberId}`,\n );\n\n const fullName =\n `${workspaceMember.name.firstName ?? ''} ${workspaceMember.name.lastName ?? ''}`.trim();\n\n return formatRecordReference({\n objectNameSingular: 'workspaceMember',\n recordId: workspaceMemberId,\n displayName: sanitizeInboxReferenceLabel(\n isNonEmptyString(fullName) ? fullName : workspaceMember.userEmail,\n ),\n });\n};\n","import { isObject, isString } from '@sniptt/guards';\nimport { isDefined } from 'twenty-shared/utils';\n\nimport { type InboxLabelIdentifierField } from '@/sdk/inbox/mentions/types/inbox-label-identifier-field.type';\n\nconst getFullNamePart = ({\n fullName,\n partName,\n}: {\n fullName: unknown;\n partName: 'firstName' | 'lastName';\n}): string => {\n const part = isObject(fullName) ? Reflect.get(fullName, partName) : undefined;\n\n return isString(part) ? part : '';\n};\n\nexport const computeInboxRecordLabel = ({\n record,\n recordId,\n labelIdentifierField,\n}: {\n record: Record<string, unknown>;\n recordId: string;\n labelIdentifierField: InboxLabelIdentifierField | undefined;\n}): string => {\n if (!isDefined(labelIdentifierField)) {\n return recordId;\n }\n\n const labelValue = record[labelIdentifierField.name];\n\n if (labelIdentifierField.type === 'FULL_NAME') {\n return `${getFullNamePart({ fullName: labelValue, partName: 'firstName' })} ${getFullNamePart({ fullName: labelValue, partName: 'lastName' })}`.trim();\n }\n\n return isDefined(labelValue) ? String(labelValue) : '';\n};\n","import { type MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { isDefined } from 'twenty-shared/utils';\n\nimport { type InboxLabelIdentifierField } from '@/sdk/inbox/mentions/types/inbox-label-identifier-field.type';\nimport { type InboxObjectMetadata } from '@/sdk/inbox/mentions/types/inbox-object-metadata.type';\n\nexport const findInboxLabelIdentifierField = async ({\n metadataClient,\n objectMetadata,\n}: {\n metadataClient: MetadataApiClient;\n objectMetadata: Pick<\n InboxObjectMetadata,\n 'id' | 'labelIdentifierFieldMetadataId'\n >;\n}): Promise<InboxLabelIdentifierField | undefined> => {\n if (!isDefined(objectMetadata.labelIdentifierFieldMetadataId)) {\n return undefined;\n }\n\n const { object } = await metadataClient.query({\n object: {\n __args: { id: objectMetadata.id },\n fields: {\n __args: {\n filter: { id: { eq: objectMetadata.labelIdentifierFieldMetadataId } },\n paging: { first: 1 },\n },\n edges: { node: { name: true, type: true } },\n },\n },\n });\n\n return object.fields.edges[0]?.node;\n};\n","import { type MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { isDefined } from 'twenty-shared/utils';\n\nimport { type InboxObjectMetadata } from '@/sdk/inbox/mentions/types/inbox-object-metadata.type';\n\nconst OBJECTS_PAGE_SIZE = 1000;\n\nexport const findInboxObjectMetadataOrThrow = async ({\n metadataClient,\n objectNameSingular,\n}: {\n metadataClient: MetadataApiClient;\n objectNameSingular: string;\n}): Promise<InboxObjectMetadata> => {\n const { objects } = await metadataClient.query({\n objects: {\n __args: { filter: {}, paging: { first: OBJECTS_PAGE_SIZE } },\n edges: {\n node: {\n id: true,\n nameSingular: true,\n namePlural: true,\n labelIdentifierFieldMetadataId: true,\n },\n },\n },\n });\n\n const objectMetadata = objects.edges.find(\n ({ node }) => node.nameSingular === objectNameSingular,\n )?.node;\n\n if (!isDefined(objectMetadata)) {\n throw new Error(`This workspace has no ${objectNameSingular} object.`);\n }\n\n return objectMetadata;\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { RestApiClient } from 'twenty-client-sdk/rest';\nimport { formatRecordReference } from 'twenty-shared/ai';\n\nimport { computeInboxRecordLabel } from '@/sdk/inbox/mentions/utils/compute-inbox-record-label.util';\nimport { findInboxLabelIdentifierField } from '@/sdk/inbox/mentions/utils/find-inbox-label-identifier-field.util';\nimport { findInboxObjectMetadataOrThrow } from '@/sdk/inbox/mentions/utils/find-inbox-object-metadata-or-throw.util';\nimport { sanitizeInboxReferenceLabel } from '@/sdk/inbox/mentions/utils/sanitize-inbox-reference-label.util';\n\nexport const inboxReferenceRecord = async ({\n objectNameSingular,\n recordId,\n}: {\n objectNameSingular: string;\n recordId: string;\n}): Promise<string> => {\n const metadataClient = new MetadataApiClient();\n const objectMetadata = await findInboxObjectMetadataOrThrow({\n metadataClient,\n objectNameSingular,\n });\n\n const [labelIdentifierField, recordResponse] = await Promise.all([\n findInboxLabelIdentifierField({ metadataClient, objectMetadata }),\n new RestApiClient().get<{\n data: Record<string, Record<string, unknown>>;\n }>(`/rest/${objectMetadata.namePlural}/${recordId}`),\n ]);\n\n return formatRecordReference({\n objectNameSingular,\n recordId,\n displayName: sanitizeInboxReferenceLabel(\n computeInboxRecordLabel({\n record: recordResponse.data[objectNameSingular],\n recordId,\n labelIdentifierField,\n }),\n ),\n });\n};\n","import {\n AGENT_CHAT_ASSISTANT_MENTION_OBJECT_NAME_SINGULAR,\n AGENT_CHAT_ASSISTANT_NAME,\n formatRecordReference,\n} from 'twenty-shared/ai';\n\nexport const INBOX_ASSISTANT_MENTION = formatRecordReference({\n objectNameSingular: AGENT_CHAT_ASSISTANT_MENTION_OBJECT_NAME_SINGULAR,\n recordId: AGENT_CHAT_ASSISTANT_MENTION_OBJECT_NAME_SINGULAR,\n displayName: AGENT_CHAT_ASSISTANT_NAME,\n});\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport {\n type EnqueueJobInput,\n type EnqueueJobResult,\n} from 'twenty-shared/application';\n\n/**\n * @deprecated Use `enqueueJobs` instead.\n */\nexport const enqueueJob = async (\n input: EnqueueJobInput,\n): Promise<EnqueueJobResult> => {\n const client = new MetadataApiClient();\n\n const { enqueueJob: result } = await client.mutation({\n enqueueJob: {\n __args: { input },\n enqueued: true,\n logicFunctionUniversalIdentifier: true,\n jobId: true,\n },\n });\n\n return result;\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport {\n type EnqueueJobsInput,\n type EnqueueJobsResult,\n} from 'twenty-shared/application';\n\nexport const enqueueJobs = async (\n input: EnqueueJobsInput,\n): Promise<EnqueueJobsResult> => {\n const client = new MetadataApiClient();\n\n const { enqueueJobs: result } = await client.mutation({\n enqueueJobs: {\n __args: { input },\n enqueued: true,\n logicFunctionUniversalIdentifier: true,\n enqueuedJobsCount: true,\n jobIds: true,\n },\n });\n\n return result;\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { type JobStatusResult } from 'twenty-shared/application';\n\nexport const getJobs = async (jobIds: string[]): Promise<JobStatusResult[]> => {\n const client = new MetadataApiClient();\n\n const { getJobs: result } = await client.query({\n getJobs: {\n __args: { jobIds },\n jobId: true,\n state: true,\n attemptsMade: true,\n failedReason: true,\n enqueuedAt: true,\n startedAt: true,\n finishedAt: true,\n },\n });\n\n return result;\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { RestApiClient } from 'twenty-client-sdk/rest';\nimport { capitalize, isDefined } from 'twenty-shared/utils';\nimport { type TimelineActivityTypeSnapshot } from 'twenty-shared/timeline';\n\ntype CreateTimelineActivityBaseInput = {\n timelineActivityTypeUniversalIdentifier: string;\n targetObjectUniversalIdentifier: string;\n targetRecordId: string;\n happensAt?: string;\n properties?: Record<string, unknown>;\n};\n\ntype CreateTimelineActivityLinkedRecordInput =\n | {\n linkedRecordId: string;\n linkedObjectMetadataUniversalIdentifier: string;\n }\n | {\n linkedRecordId?: never;\n linkedObjectMetadataUniversalIdentifier?: never;\n };\n\nexport type CreateTimelineActivityInput = CreateTimelineActivityBaseInput &\n CreateTimelineActivityLinkedRecordInput;\n\nexport type CreatedTimelineActivity = {\n id: string;\n timelineActivityTypeId: string;\n timelineActivityTypeSnapshot: TimelineActivityTypeSnapshot;\n};\n\nconst getObjectMetadataSelection = (universalIdentifiers: string[]) => ({\n __args: {\n paging: {\n first: universalIdentifiers.length,\n },\n filter: {\n universalIdentifier: {\n in: universalIdentifiers,\n },\n },\n },\n edges: {\n node: {\n id: true,\n universalIdentifier: true,\n nameSingular: true,\n },\n },\n});\n\n// Apps address manifest entities by universal identifier; the row stores the installation-specific metadata id\nexport const createTimelineActivity = async ({\n timelineActivityTypeUniversalIdentifier,\n targetObjectUniversalIdentifier,\n linkedObjectMetadataUniversalIdentifier,\n targetRecordId,\n ...input\n}: CreateTimelineActivityInput): Promise<CreatedTimelineActivity> => {\n const requiredObjectUniversalIdentifiers = [\n ...new Set(\n [\n targetObjectUniversalIdentifier,\n linkedObjectMetadataUniversalIdentifier,\n ].filter(isDefined),\n ),\n ];\n const metadataClient = new MetadataApiClient();\n const { timelineActivityTypes, objects } = await metadataClient.query({\n timelineActivityTypes: {\n id: true,\n universalIdentifier: true,\n isActive: true,\n },\n objects: getObjectMetadataSelection(requiredObjectUniversalIdentifiers),\n });\n\n const timelineActivityType = timelineActivityTypes.find(\n ({ universalIdentifier }) =>\n universalIdentifier === timelineActivityTypeUniversalIdentifier,\n );\n\n if (!isDefined(timelineActivityType)) {\n throw new Error(\n `Timeline activity type ${timelineActivityTypeUniversalIdentifier} is not installed`,\n );\n }\n\n if (!timelineActivityType.isActive) {\n throw new Error(\n `Timeline activity type ${timelineActivityTypeUniversalIdentifier} is inactive`,\n );\n }\n\n const objectMetadataByUniversalIdentifier = new Map(\n objects.edges.map(({ node }) => [node.universalIdentifier, node]),\n );\n\n const targetObject = objectMetadataByUniversalIdentifier.get(\n targetObjectUniversalIdentifier,\n );\n\n if (!isDefined(targetObject)) {\n throw new Error(\n `Timeline activity target object ${targetObjectUniversalIdentifier} is not installed`,\n );\n }\n\n const targetFieldName = `target${capitalize(targetObject.nameSingular)}Id`;\n const linkedObject = isDefined(linkedObjectMetadataUniversalIdentifier)\n ? objectMetadataByUniversalIdentifier.get(\n linkedObjectMetadataUniversalIdentifier,\n )\n : undefined;\n\n if (\n isDefined(linkedObjectMetadataUniversalIdentifier) &&\n !isDefined(linkedObject)\n ) {\n throw new Error(\n `Timeline activity linked object ${linkedObjectMetadataUniversalIdentifier} is not installed`,\n );\n }\n\n const response = await new RestApiClient().post<{\n data: { createTimelineActivity: CreatedTimelineActivity };\n }>('/rest/timelineActivities', {\n ...input,\n timelineActivityTypeId: timelineActivityType.id,\n linkedObjectMetadataId: linkedObject?.id,\n [targetFieldName]: targetRecordId,\n });\n\n return response.data.createTimelineActivity;\n};\n","import {\n type AppKeyValue,\n type AppKeyValueScope,\n} from 'twenty-shared/application';\n\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst GET_APP_KEY_VALUE_QUERY = `\n query GetAppKeyValue($key: String!, $scope: AppKeyValueScope) {\n appKeyValue(key: $key, scope: $scope) {\n key\n value\n scope\n }\n }\n`;\n\nconst SET_APP_KEY_VALUE_MUTATION = `\n mutation SetAppKeyValue($input: SetAppKeyValueInput!) {\n setAppKeyValue(input: $input) {\n key\n value\n scope\n }\n }\n`;\n\nconst DELETE_APP_KEY_VALUE_MUTATION = `\n mutation DeleteAppKeyValue($key: String!, $scope: AppKeyValueScope) {\n deleteAppKeyValue(key: $key, scope: $scope)\n }\n`;\n\nconst DEFAULT_APP_KEY_VALUE_SCOPE: AppKeyValueScope = 'WORKSPACE';\n\ntype KvOptions = {\n scope?: AppKeyValueScope;\n};\n\nexport const kv = {\n async get<TValue = unknown>(\n key: string,\n options?: KvOptions,\n ): Promise<TValue | null> {\n const { appKeyValue } = await postGraphqlRequest<\n { key: string; scope: AppKeyValueScope },\n { appKeyValue: AppKeyValue | null }\n >({\n query: GET_APP_KEY_VALUE_QUERY,\n variables: { key, scope: options?.scope ?? DEFAULT_APP_KEY_VALUE_SCOPE },\n caller: 'kv.get',\n });\n\n return (appKeyValue?.value ?? null) as TValue | null;\n },\n\n async set<TValue>(\n key: string,\n value: TValue,\n options?: KvOptions,\n ): Promise<void> {\n await postGraphqlRequest<\n {\n input: { key: string; value: TValue; scope: AppKeyValueScope };\n },\n { setAppKeyValue: AppKeyValue }\n >({\n query: SET_APP_KEY_VALUE_MUTATION,\n variables: {\n input: {\n key,\n value,\n scope: options?.scope ?? DEFAULT_APP_KEY_VALUE_SCOPE,\n },\n },\n caller: 'kv.set',\n });\n },\n\n async delete(key: string, options?: KvOptions): Promise<boolean> {\n const { deleteAppKeyValue } = await postGraphqlRequest<\n { key: string; scope: AppKeyValueScope },\n { deleteAppKeyValue: boolean }\n >({\n query: DELETE_APP_KEY_VALUE_MUTATION,\n variables: { key, scope: options?.scope ?? DEFAULT_APP_KEY_VALUE_SCOPE },\n caller: 'kv.delete',\n });\n\n return deleteAppKeyValue;\n },\n};\n","import { type LogicFunctionHttpResponse } from 'twenty-shared/types';\n\nexport type ResponseInit = {\n status?: number;\n headers?: Record<string, string>;\n};\n\nexport class Response implements LogicFunctionHttpResponse {\n readonly __twentyHttpResponse = true as const;\n readonly body: unknown;\n readonly status?: number;\n readonly headers?: Record<string, string>;\n\n constructor(body: unknown, init?: ResponseInit) {\n this.body = body;\n this.status = init?.status;\n this.headers = init?.headers;\n }\n}\n"],"mappings":"+KAEA,IAAIA,EAAK,GAAM,EAAA,EAAA,EAAA,YAAA,CAAG,CAAC,GAAK,EAAA,EAAA,EAAA,OAAA,CAAG,CAAC,ECsBzB,EAAK,GAAM,CACb,IAAI,EAAI,CAAE,KAAM,SAAU,EAC1B,OAAQ,EAAE,KAAV,CACC,IAAK,SACJ,EAAE,KAAO,SACT,MACD,IAAK,SACL,IAAK,UACJ,EAAE,KAAO,SACT,MACD,IAAK,UACJ,EAAE,KAAO,UACT,MACD,IAAK,QACJ,EAAE,KAAO,QAAS,EAAE,QAAU,EAAE,MAAQ,EAAE,EAAE,KAAK,GACjD,MACD,IAAK,SACJ,EAAE,KAAO,SAAU,EAAE,aAAe,EAAE,WAAa,OAAO,YA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AsB,MAAM,EAGlC,CACA,MAAO,GACP,UAAW,CAAE,MAAK,MAAO,GAAS,OAAS,CAA4B,EACvE,OAAQ,WACV,CAAC,EAED,OAAO,CACT,CACF,ECpFa,GAAb,KAA2D,CAMzD,YAAY,EAAe,EAAqB,2BALhB,GAM9B,KAAK,KAAO,EACZ,KAAK,OAAS,GAAM,OACpB,KAAK,QAAU,GAAM,OACvB,CACF"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["n","s","e","n","e"],"sources":["../../../twenty-shared/dist/isDefined-Dtu5EYqP.mjs","../../../twenty-shared/dist/logic-function.mjs","../../src/sdk/logic-function/connections/errors/app-connection-auth-failed.error.ts","../../../twenty-shared/dist/application-runtime.mjs","../../src/sdk/logic-function/connections/utils/with-legacy-connection-visibility.util.ts","../../src/sdk/utils/get-application-access-token.ts","../../src/sdk/logic-function/utils/post-graphql-request.util.ts","../../src/sdk/logic-function/connections/get-connection.ts","../../../twenty-shared/dist/get-ai-model-tier-from-model-id.util-C26DZ9rM.mjs","../../../twenty-shared/dist/capitalize-DFPVt1IM.mjs","../../src/sdk/logic-function/connections/list-connections.ts","../../src/sdk/logic-function/connections/find-connection-for-request.ts","../../src/sdk/logic-function/connections/report-connection-auth-failure.ts","../../src/sdk/logic-function/messaging/message-channel-fields.constant.ts","../../src/sdk/logic-function/messaging/create-message-channel.ts","../../src/sdk/logic-function/messaging/list-message-channels.ts","../../src/sdk/logic-function/messaging/update-message-channel.ts","../../src/sdk/logic-function/messaging/delete-message-channel.ts","../../src/sdk/logic-function/messaging/ingest-messages.ts","../../src/sdk/logic-function/messaging/message-folder-fields.constant.ts","../../src/sdk/logic-function/messaging/list-message-folders.ts","../../src/sdk/logic-function/messaging/sync-message-folders.ts","../../src/sdk/logic-function/agents/run-agent.ts","../../src/sdk/inbox/send-inbox-message.ts","../../src/sdk/inbox/mentions/utils/sanitize-inbox-reference-label.util.ts","../../src/sdk/inbox/mentions/inbox-mention.ts","../../src/sdk/inbox/mentions/utils/compute-inbox-record-label.util.ts","../../src/sdk/inbox/mentions/utils/find-inbox-label-identifier-field.util.ts","../../src/sdk/inbox/mentions/utils/find-inbox-object-metadata-or-throw.util.ts","../../src/sdk/inbox/mentions/inbox-reference-record.ts","../../src/sdk/inbox/mentions/inbox-assistant-mention.ts","../../src/sdk/inbox/attach-record-to-inbox-thread.ts","../../src/sdk/inbox/detach-record-from-inbox-thread.ts","../../src/sdk/logic-function/jobs/enqueue-job.ts","../../src/sdk/logic-function/jobs/enqueue-jobs.ts","../../src/sdk/logic-function/jobs/get-jobs.ts","../../src/sdk/logic-function/timeline/create-timeline-activity.ts","../../src/sdk/logic-function/key-value/kv.ts","../../src/sdk/logic-function/response.ts"],"sourcesContent":["import { isNull as e, isUndefined as t } from \"@sniptt/guards\";\n//#region src/utils/validation/isDefined.ts\nvar n = (n) => !t(n) && !e(n);\n//#endregion\nexport { n as t };\n","import { t as e } from \"./isDefined-Dtu5EYqP.mjs\";\nimport { t } from \"./is-record-object-schema-CwzshFdt.mjs\";\nimport { isNonEmptyString as n, isObject as r } from \"@sniptt/guards\";\n//#region src/logic-function/build-tool-input-json-schema.ts\nvar i = (e, t) => {\n\tlet r = n(e) ? t?.(e) : void 0;\n\treturn `Id of the ${n(r) ? r : \"linked\"} record`;\n}, a = (n, o) => {\n\tif (t(n)) return {\n\t\ttype: \"string\",\n\t\tdescription: i(n.objectUniversalIdentifier, o)\n\t};\n\tif (n.type === \"records\") return {\n\t\ttype: \"array\",\n\t\titems: {\n\t\t\ttype: \"string\",\n\t\t\tdescription: i(n.objectUniversalIdentifier, o)\n\t\t}\n\t};\n\tlet { objectUniversalIdentifier: s, multiline: c, label: l, items: u, properties: d, additionalProperties: f, ...p } = n, m = { ...p };\n\treturn e(u) && (m.items = a(u, o)), e(d) && (m.properties = Object.fromEntries(Object.entries(d).map(([e, t]) => [e, a(t, o)]))), e(f) && (m.additionalProperties = r(f) ? a(f, o) : f), m;\n}, o = {\n\ttype: \"object\",\n\tproperties: {}\n}, s = (e) => {\n\tlet t = { type: \"unknown\" };\n\tswitch (e.type) {\n\t\tcase \"string\":\n\t\t\tt.type = \"string\";\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\tcase \"integer\":\n\t\t\tt.type = \"number\";\n\t\t\tbreak;\n\t\tcase \"boolean\":\n\t\t\tt.type = \"boolean\";\n\t\t\tbreak;\n\t\tcase \"array\":\n\t\t\tt.type = \"array\", e.items && (t.items = s(e.items));\n\t\t\tbreak;\n\t\tcase \"object\":\n\t\t\tt.type = \"object\", e.properties && (t.properties = Object.fromEntries(Object.entries(e.properties).map(([e, t]) => [e, s(t)])));\n\t\t\tbreak;\n\t\tcase \"record\":\n\t\t\tt.type = \"record\";\n\t\t\tbreak;\n\t\tcase \"records\":\n\t\t\tt.type = \"records\";\n\t\t\tbreak;\n\t\tdefault: t.type = \"unknown\";\n\t}\n\treturn Array.isArray(e.enum) && (t.enum = e.enum.filter((e) => typeof e == \"string\")), e.multiline === !0 && (t.multiline = !0), n(e.label) && (t.label = e.label), n(e.objectUniversalIdentifier) && (t.objectUniversalIdentifier = e.objectUniversalIdentifier), t;\n}, c = (e) => [s(e)], l = { inputSchema: c({\n\ttype: \"object\",\n\tproperties: {\n\t\ta: { type: \"string\" },\n\t\tb: { type: \"number\" }\n\t}\n}) }, u = async (t) => {\n\tlet { getFunctionInputSchema: n } = await import(\"./get-function-input-schema-GNk3NRLJ.mjs\"), r = n(t)[0];\n\treturn r?.type === \"object\" && e(r.properties) ? {\n\t\ttype: \"object\",\n\t\tproperties: r.properties\n\t} : o;\n}, d = (t) => !e(t) || t === null ? \"unknown\" : typeof t == \"string\" ? \"string\" : typeof t == \"number\" ? \"number\" : typeof t == \"boolean\" ? \"boolean\" : Array.isArray(t) ? \"array\" : \"unknown\", f = (e) => e ? Object.entries(e).reduce((e, [t, n]) => (r(n) && !Array.isArray(n) ? e[t] = {\n\tisLeaf: !1,\n\ttype: \"object\",\n\tlabel: t,\n\tvalue: f(n)\n} : e[t] = {\n\tisLeaf: !0,\n\tvalue: n,\n\ttype: d(n),\n\tlabel: t\n}, e), {}) : {}, p = (e, t) => e ? `${e}.${t}` : t, m = (t, n, r = \"\") => {\n\tlet i = [];\n\tfor (let [a, o] of Object.entries(n)) {\n\t\tlet n = p(r, a), s = t[a];\n\t\tif (!e(s)) {\n\t\t\ti.push(`Missing key \"${n}\" in declared output schema.`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (o.isLeaf !== s.isLeaf) {\n\t\t\ti.push(`Type mismatch at \"${n}\": expected ${o.isLeaf ? o.type : \"object\"} but declared ${s.isLeaf ? s.type : \"object\"}.`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!o.isLeaf && !s.isLeaf) {\n\t\t\ti.push(...m(s.value, o.value, n));\n\t\t\tcontinue;\n\t\t}\n\t\to.isLeaf && s.isLeaf && o.type !== \"unknown\" && s.type !== \"unknown\" && o.type !== s.type && i.push(`Type mismatch at \"${n}\": expected ${o.type} but declared ${s.type}.`);\n\t}\n\treturn i;\n}, h = [\n\t\"string\",\n\t\"number\",\n\t\"boolean\",\n\t\"array\",\n\t\"unknown\"\n], g = (e) => h.includes(e), _ = (e, t) => {\n\tlet n = t.label ?? e;\n\treturn t.type === \"record\" ? {\n\t\tisLeaf: !0,\n\t\ttype: \"string\",\n\t\tlabel: n,\n\t\tvalue: null\n\t} : t.type === \"records\" ? {\n\t\tisLeaf: !0,\n\t\ttype: \"array\",\n\t\tlabel: n,\n\t\tvalue: null\n\t} : t.type === \"object\" ? {\n\t\tisLeaf: !1,\n\t\ttype: \"object\",\n\t\tlabel: n,\n\t\tvalue: r(t.properties) ? v(t.properties) : {}\n\t} : {\n\t\tisLeaf: !0,\n\t\ttype: g(t.type) ? t.type : \"unknown\",\n\t\tlabel: n,\n\t\tvalue: null\n\t};\n}, v = (e) => Object.entries(e).reduce((e, [t, n]) => (e[t] = _(t, n), e), {}), y = (e) => {\n\tlet t = e[0];\n\treturn t?.type !== \"object\" || !r(t.properties) ? {} : v(t.properties);\n}, b = (e) => e?.type === \"records\" && n(e.objectUniversalIdentifier) || e?.type === \"array\" && t(e?.items), x = \"RetryableLogicFunctionError\", S = class extends Error {\n\tconstructor(e) {\n\t\tsuper(e), this.name = x;\n\t}\n};\n//#endregion\nexport { o as DEFAULT_TOOL_INPUT_SCHEMA, x as RETRYABLE_LOGIC_FUNCTION_ERROR_NAME, S as RetryableLogicFunctionError, l as SEED_WORKFLOW_ACTION_TRIGGER_SETTINGS, a as buildToolInputJsonSchema, u as getInputSchemaFromSourceCode, f as getOutputSchemaFromValue, m as getOutputSchemaMismatchIssues, y as inputSchemaToOutputSchema, b as isRecordArraySchema, t as isRecordObjectSchema, c as jsonSchemaToInputSchema };\n","// Thrown when the platform asks the SDK to operate on a connection whose\n// OAuth refresh failed permanently (`authFailedAt` is set). The end user\n// must reconnect from the app's settings tab — the app cannot recover on\n// its own.\n//\n// `listConnections` filters these out by default (the user can't act on\n// them anyway). `getConnection` throws this when the looked-up connection\n// is in this state, so a stored connection id can be safely retried until\n// it works again.\nexport class AppConnectionAuthFailedError extends Error {\n readonly connectionId: string;\n\n constructor(connectionId: string) {\n super(\n `App connection ${connectionId} requires the user to reconnect ` +\n `(authFailedAt is set). Surface a \"Reconnect\" prompt in your UI.`,\n );\n this.name = 'AppConnectionAuthFailedError';\n this.connectionId = connectionId;\n }\n}\n","//#region src/application-runtime/constants/ConnectionScopeByLegacyVisibility.ts\nvar e = {\n\tuser: \"USER\",\n\tworkspace: \"WORKSPACE\"\n}, t = \"TWENTY_API_KEY\", n = \"TWENTY_API_URL\", r = \"TWENTY_APP_ACCESS_TOKEN\", i = \"TWENTY_APP_APPLICATION_ACCESS_TOKEN\", a = \"TWENTY_FUNCTIONS_URL\", o = \"TWENTY_SERVER_ROUTES_URL\", s = {\n\tUSER: \"user\",\n\tWORKSPACE: \"workspace\"\n}, c = [\n\t\"workspace-suspended\",\n\t\"no-subscription\",\n\t\"no-credits\"\n];\n//#endregion\nexport { e as CONNECTION_SCOPE_BY_LEGACY_VISIBILITY, c as CREDIT_UNAVAILABLE_REASONS, t as DEFAULT_API_KEY_NAME, n as DEFAULT_API_URL_NAME, r as DEFAULT_APP_ACCESS_TOKEN_NAME, i as DEFAULT_APP_APPLICATION_ACCESS_TOKEN_NAME, a as DEFAULT_FUNCTIONS_URL_NAME, o as DEFAULT_SERVER_ROUTES_URL_NAME, s as LEGACY_CONNECTION_VISIBILITY_BY_SCOPE };\n","import { LEGACY_CONNECTION_VISIBILITY_BY_SCOPE } from 'twenty-shared/application-runtime';\n\nimport { type AppConnection } from '@/sdk/logic-function/connections/types/app-connection.type';\n\ntype WithoutVisibility<TConnection> = TConnection extends unknown\n ? Omit<TConnection, 'visibility'>\n : never;\n\nexport type AppConnectionWithoutVisibility = WithoutVisibility<AppConnection>;\n\nexport const withLegacyConnectionVisibility = (\n connection: AppConnectionWithoutVisibility,\n): AppConnection => ({\n ...connection,\n visibility: LEGACY_CONNECTION_VISIBILITY_BY_SCOPE[connection.scope],\n});\n","import {\n DEFAULT_APP_ACCESS_TOKEN_NAME,\n DEFAULT_APP_APPLICATION_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application-runtime';\n\n// These reach the application's own resources, so prefer the application token when the runtime injects one\nexport const getApplicationAccessToken = (): string | undefined =>\n process.env[DEFAULT_APP_APPLICATION_ACCESS_TOKEN_NAME] ??\n process.env[DEFAULT_APP_ACCESS_TOKEN_NAME];\n","import {\n DEFAULT_API_URL_NAME,\n DEFAULT_APP_APPLICATION_ACCESS_TOKEN_NAME,\n} from 'twenty-shared/application-runtime';\n\nimport { getApplicationAccessToken } from '@/sdk/utils/get-application-access-token';\n\nexport const postGraphqlRequest = async <TVariables, TData>({\n query,\n variables,\n caller,\n}: {\n query: string;\n variables: TVariables;\n caller: string;\n}): Promise<TData> => {\n const apiUrl = process.env[DEFAULT_API_URL_NAME];\n const accessToken = getApplicationAccessToken();\n\n if (!apiUrl || !accessToken) {\n throw new Error(\n `${caller}() requires the app runtime env vars ` +\n `${DEFAULT_API_URL_NAME} and ${DEFAULT_APP_APPLICATION_ACCESS_TOKEN_NAME}.`,\n );\n }\n\n const response = await fetch(`${apiUrl}/metadata`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${accessToken}`,\n },\n body: JSON.stringify({ query, variables }),\n });\n\n if (!response.ok) {\n throw new Error(\n `${caller}() failed: HTTP ${response.status} ${response.statusText}`,\n );\n }\n\n const body = (await response.json()) as {\n data?: TData;\n errors?: { message: string }[];\n };\n\n if (body.errors && body.errors.length > 0) {\n throw new Error(\n `${caller}() failed: ${body.errors.map((error) => error.message).join(', ')}`,\n );\n }\n\n if (!body.data) {\n throw new Error(`${caller}() failed: response contained no data.`);\n }\n\n return body.data;\n};\n","import { AppConnectionAuthFailedError } from '@/sdk/logic-function/connections/errors/app-connection-auth-failed.error';\nimport { type AppConnection } from '@/sdk/logic-function/connections/types/app-connection.type';\nimport {\n type AppConnectionWithoutVisibility,\n withLegacyConnectionVisibility,\n} from '@/sdk/logic-function/connections/utils/with-legacy-connection-visibility.util';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst GET_APP_CONNECTION_QUERY = `\n query GetAppConnection($id: ID!) {\n appConnection(id: $id) {\n id\n providerName\n name\n handle\n externalAccountId\n scope\n userWorkspaceId\n workspaceMemberId\n providerType\n accessToken\n scopes\n authFailedAt\n authFailedReason\n }\n }\n`;\n\nexport const getConnection = async (id: string): Promise<AppConnection> => {\n const { appConnection } = await postGraphqlRequest<\n { id: string },\n { appConnection: AppConnectionWithoutVisibility }\n >({\n query: GET_APP_CONNECTION_QUERY,\n variables: { id },\n caller: 'getConnection',\n });\n\n if (appConnection.authFailedAt !== null) {\n throw new AppConnectionAuthFailedError(appConnection.id);\n }\n\n return withLegacyConnectionVisibility(appConnection);\n};\n","//#region src/ai/constants/agent-chat-assistant-mention-object-name-singular.const.ts\nvar e = \"agentChatAssistant\", t = [\n\t\"extraFast\",\n\t\"fast\",\n\t\"balanced\",\n\t\"smart\",\n\t\"extraSmart\"\n], n = {\n\textraFast: \"default-extra-fast-model\",\n\tfast: \"default-fast-model\",\n\tbalanced: \"default-balanced-model\",\n\tsmart: \"default-smart-model\",\n\textraSmart: \"default-extra-smart-model\"\n}, r = \"workspace-default-model\", i = (e) => /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e), a = ({ objectNameSingular: e, recordId: t, displayName: n }) => e === \"agentChatAssistant\" ? `@${n}` : `[[record:${e}:${t}:${n}]]`, o = ({ skillId: e, label: t }) => `[[skill:${e}:${t}]]`, s = (e) => t.find((t) => n[t] === e);\n//#endregion\nexport { r as a, e as c, i, o as n, n as o, a as r, t as s, s as t };\n","import { isNonEmptyString as e } from \"@sniptt/guards\";\n//#region src/i18n/do-not-translate.ts\nvar t = (e) => e, n = (t) => e(t) ? t.charAt(0).toUpperCase() + t.slice(1) : \"\";\n//#endregion\nexport { t as n, n as t };\n","import { CONNECTION_SCOPE_BY_LEGACY_VISIBILITY } from 'twenty-shared/application-runtime';\nimport { isDefined } from 'twenty-shared/utils';\n\nimport { type AppConnection } from '@/sdk/logic-function/connections/types/app-connection.type';\nimport {\n type AppConnectionWithoutVisibility,\n withLegacyConnectionVisibility,\n} from '@/sdk/logic-function/connections/utils/with-legacy-connection-visibility.util';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst LIST_APP_CONNECTIONS_QUERY = `\n query ListAppConnections($filter: ListAppConnectionsInput) {\n appConnections(filter: $filter) {\n id\n providerName\n name\n handle\n externalAccountId\n scope\n userWorkspaceId\n workspaceMemberId\n providerType\n accessToken\n scopes\n authFailedAt\n authFailedReason\n }\n }\n`;\n\nexport type ListConnectionsFilter = {\n providerName?: string;\n userWorkspaceId?: string;\n scope?: AppConnection['scope'];\n /** @deprecated Use `scope` instead. */\n visibility?: AppConnection['visibility'];\n};\n\nexport const listConnections = async ({\n visibility,\n ...filter\n}: ListConnectionsFilter = {}): Promise<AppConnection[]> => {\n const { appConnections } = await postGraphqlRequest<\n { filter: Omit<ListConnectionsFilter, 'visibility'> },\n { appConnections: AppConnectionWithoutVisibility[] }\n >({\n query: LIST_APP_CONNECTIONS_QUERY,\n variables: {\n filter: {\n ...filter,\n scope:\n filter.scope ??\n (isDefined(visibility)\n ? CONNECTION_SCOPE_BY_LEGACY_VISIBILITY[visibility]\n : undefined),\n },\n },\n caller: 'listConnections',\n });\n\n return appConnections.map(withLegacyConnectionVisibility);\n};\n","import { type AppConnection } from '@/sdk/logic-function/connections/types/app-connection.type';\n\nexport const findConnectionForRequest = (\n connections: AppConnection[],\n event: { userWorkspaceId: string | null },\n): AppConnection | null => {\n if (event.userWorkspaceId !== null) {\n const personal = connections.find(\n (connection) =>\n connection.scope === 'USER' &&\n connection.userWorkspaceId === event.userWorkspaceId,\n );\n\n if (personal) {\n return personal;\n }\n }\n\n const workspaceShared = connections.find(\n (connection) => connection.scope === 'WORKSPACE',\n );\n\n return workspaceShared ?? null;\n};\n","import { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst REPORT_APP_CONNECTION_AUTH_FAILURE_MUTATION = `\n mutation ReportAppConnectionAuthFailure($input: ReportAppConnectionAuthFailureInput!) {\n reportAppConnectionAuthFailure(input: $input)\n }\n`;\n\nexport const reportConnectionAuthFailure = async ({\n connectionId,\n reason,\n}: {\n connectionId: string;\n reason?: string;\n}): Promise<void> => {\n await postGraphqlRequest<\n { input: { id: string; reason?: string } },\n { reportAppConnectionAuthFailure: boolean }\n >({\n query: REPORT_APP_CONNECTION_AUTH_FAILURE_MUTATION,\n variables: { input: { id: connectionId, reason } },\n caller: 'reportConnectionAuthFailure',\n });\n};\n","// Shared by every helper, so channels returned by any of them are interchangeable\nexport const APP_MESSAGE_CHANNEL_SELECTION = `\n id\n handle\n displayName\n visibility\n connectedAccountId\n isSyncEnabled\n participantHandleFieldUniversalIdentifier\n messagingProviderUniversalIdentifier\n`;\n","import { type MessageChannelVisibility } from '@/sdk/define/common/types/loose-shared-types.type';\nimport { APP_MESSAGE_CHANNEL_SELECTION } from '@/sdk/logic-function/messaging/message-channel-fields.constant';\nimport { type AppMessageChannel } from '@/sdk/logic-function/messaging/types/app-message-channel.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst CREATE_APP_MESSAGE_CHANNEL_MUTATION = `\n mutation CreateAppMessageChannel($input: CreateAppMessageChannelInput!) {\n createAppMessageChannel(input: $input) {\n ${APP_MESSAGE_CHANNEL_SELECTION}\n }\n }\n`;\n\nexport type CreateMessageChannelInput = {\n // An app connection id (from getConnection/listConnections); the channel speaks through it and inherits who may see it\n connectedAccountId: string;\n // The account's provider identity; inbound participants matching it are treated as the account itself\n handle: string;\n displayName?: string;\n // Required: decides whether one member's conversations are readable by the whole workspace, and only the app\n // knows how private its messages are ('METADATA' for personal inboxes, 'SHARE_EVERYTHING' for shared ones)\n visibility: MessageChannelVisibility;\n // Person field to match participant handles against (handles are then stored in its canonical form); set once\n participantHandleFieldUniversalIdentifier?: string;\n messagingProvider?: { universalIdentifier: string };\n};\n\nexport const createMessageChannel = async ({\n messagingProvider,\n ...input\n}: CreateMessageChannelInput): Promise<AppMessageChannel> => {\n const { createAppMessageChannel } = await postGraphqlRequest<\n {\n input: Omit<CreateMessageChannelInput, 'messagingProvider'> & {\n messagingProviderUniversalIdentifier?: string;\n };\n },\n { createAppMessageChannel: AppMessageChannel }\n >({\n query: CREATE_APP_MESSAGE_CHANNEL_MUTATION,\n variables: {\n input: {\n ...input,\n messagingProviderUniversalIdentifier:\n messagingProvider?.universalIdentifier,\n },\n },\n caller: 'createMessageChannel',\n });\n\n return createAppMessageChannel;\n};\n","import { APP_MESSAGE_CHANNEL_SELECTION } from '@/sdk/logic-function/messaging/message-channel-fields.constant';\nimport { type AppMessageChannel } from '@/sdk/logic-function/messaging/types/app-message-channel.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst LIST_APP_MESSAGE_CHANNELS_QUERY = `\n query ListAppMessageChannels($filter: ListAppMessageChannelsInput) {\n appMessageChannels(filter: $filter) {\n ${APP_MESSAGE_CHANNEL_SELECTION}\n }\n }\n`;\n\nexport type ListMessageChannelsFilter = {\n connectedAccountId?: string;\n};\n\nexport const listMessageChannels = async (\n filter: ListMessageChannelsFilter = {},\n): Promise<AppMessageChannel[]> => {\n const { appMessageChannels } = await postGraphqlRequest<\n { filter: ListMessageChannelsFilter },\n { appMessageChannels: AppMessageChannel[] }\n >({\n query: LIST_APP_MESSAGE_CHANNELS_QUERY,\n variables: { filter },\n caller: 'listMessageChannels',\n });\n\n return appMessageChannels;\n};\n","import { type MessageChannelVisibility } from '@/sdk/define/common/types/loose-shared-types.type';\nimport { APP_MESSAGE_CHANNEL_SELECTION } from '@/sdk/logic-function/messaging/message-channel-fields.constant';\nimport { type AppMessageChannel } from '@/sdk/logic-function/messaging/types/app-message-channel.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst UPDATE_APP_MESSAGE_CHANNEL_MUTATION = `\n mutation UpdateAppMessageChannel($input: UpdateAppMessageChannelInput!) {\n updateAppMessageChannel(input: $input) {\n ${APP_MESSAGE_CHANNEL_SELECTION}\n }\n }\n`;\n\nexport type UpdateMessageChannelInput = {\n id: string;\n // Omitted leaves the current label untouched; null clears it.\n displayName?: string | null;\n // Changes who can read every message already ingested, not just the ones that follow\n visibility?: MessageChannelVisibility;\n // False pauses ingestion (further ingests are rejected) without deleting the history\n isSyncEnabled?: boolean;\n messagingProvider?: { universalIdentifier: string } | null;\n};\n\nexport const updateMessageChannel = async ({\n messagingProvider,\n ...input\n}: UpdateMessageChannelInput): Promise<AppMessageChannel> => {\n const { updateAppMessageChannel } = await postGraphqlRequest<\n {\n input: Omit<UpdateMessageChannelInput, 'messagingProvider'> & {\n messagingProviderUniversalIdentifier?: string | null;\n };\n },\n { updateAppMessageChannel: AppMessageChannel }\n >({\n query: UPDATE_APP_MESSAGE_CHANNEL_MUTATION,\n variables: {\n input: {\n ...input,\n messagingProviderUniversalIdentifier:\n messagingProvider === undefined\n ? undefined\n : (messagingProvider?.universalIdentifier ?? null),\n },\n },\n caller: 'updateMessageChannel',\n });\n\n return updateAppMessageChannel;\n};\n","import { APP_MESSAGE_CHANNEL_SELECTION } from '@/sdk/logic-function/messaging/message-channel-fields.constant';\nimport { type AppMessageChannel } from '@/sdk/logic-function/messaging/types/app-message-channel.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst DELETE_APP_MESSAGE_CHANNEL_MUTATION = `\n mutation DeleteAppMessageChannel($id: UUID!) {\n deleteAppMessageChannel(id: $id) {\n ${APP_MESSAGE_CHANNEL_SELECTION}\n }\n }\n`;\n\n// Also deletes the channel's ingested messages and emptied threads; call from onDisconnect to retire a channel with its credential.\n// To stop ingesting but keep the history, set `isSyncEnabled` to false instead.\nexport const deleteMessageChannel = async (\n id: string,\n): Promise<AppMessageChannel> => {\n const { deleteAppMessageChannel } = await postGraphqlRequest<\n { id: string },\n { deleteAppMessageChannel: AppMessageChannel }\n >({\n query: DELETE_APP_MESSAGE_CHANNEL_MUTATION,\n variables: { id },\n caller: 'deleteMessageChannel',\n });\n\n return deleteAppMessageChannel;\n};\n","import {\n type IngestMessage,\n type IngestedMessage,\n} from '@/sdk/logic-function/messaging/types/ingest-message.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst INGEST_APP_MESSAGES_MUTATION = `\n mutation IngestAppMessages($input: IngestAppMessagesInput!) {\n ingestAppMessages(input: $input) {\n messages {\n externalId\n messageId\n messageThreadId\n }\n }\n }\n`;\n\n// Threading, dedup and privacy are handled server-side. At most 100 messages per call (one transaction\n// within one logic-function timeout), so page provider backfills\nexport const ingestMessages = async ({\n messageChannelId,\n messages,\n}: {\n messageChannelId: string;\n messages: IngestMessage[];\n}): Promise<IngestedMessage[]> => {\n const { ingestAppMessages } = await postGraphqlRequest<\n { input: { messageChannelId: string; messages: IngestMessage[] } },\n { ingestAppMessages: { messages: IngestedMessage[] } }\n >({\n query: INGEST_APP_MESSAGES_MUTATION,\n variables: { input: { messageChannelId, messages } },\n caller: 'ingestMessages',\n });\n\n return ingestAppMessages.messages;\n};\n","export const APP_MESSAGE_FOLDER_SELECTION = `\n id\n externalId\n name\n isSynced\n messageChannelId\n`;\n","import { APP_MESSAGE_FOLDER_SELECTION } from '@/sdk/logic-function/messaging/message-folder-fields.constant';\nimport { type AppMessageFolder } from '@/sdk/logic-function/messaging/types/app-message-folder.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst LIST_APP_MESSAGE_FOLDERS_QUERY = `\n query ListAppMessageFolders($filter: ListAppMessageFoldersInput) {\n appMessageFolders(filter: $filter) {\n ${APP_MESSAGE_FOLDER_SELECTION}\n }\n }\n`;\n\nexport type ListMessageFoldersFilter = {\n messageChannelId?: string;\n};\n\nexport const listMessageFolders = async (\n filter: ListMessageFoldersFilter = {},\n): Promise<AppMessageFolder[]> => {\n const { appMessageFolders } = await postGraphqlRequest<\n { filter: ListMessageFoldersFilter },\n { appMessageFolders: AppMessageFolder[] }\n >({\n query: LIST_APP_MESSAGE_FOLDERS_QUERY,\n variables: { filter },\n caller: 'listMessageFolders',\n });\n\n return appMessageFolders;\n};\n","import { APP_MESSAGE_FOLDER_SELECTION } from '@/sdk/logic-function/messaging/message-folder-fields.constant';\nimport { type AppMessageFolder } from '@/sdk/logic-function/messaging/types/app-message-folder.type';\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst SYNC_APP_MESSAGE_FOLDERS_MUTATION = `\n mutation SyncAppMessageFolders($input: SyncAppMessageFoldersInput!) {\n syncAppMessageFolders(input: $input) {\n ${APP_MESSAGE_FOLDER_SELECTION}\n }\n }\n`;\n\nexport type SyncMessageFoldersInput = {\n messageChannelId: string;\n folders: {\n externalId: string;\n name: string;\n isSynced?: boolean;\n }[];\n};\n\nexport const syncMessageFolders = async (\n input: SyncMessageFoldersInput,\n): Promise<AppMessageFolder[]> => {\n const { syncAppMessageFolders } = await postGraphqlRequest<\n { input: SyncMessageFoldersInput },\n { syncAppMessageFolders: AppMessageFolder[] }\n >({\n query: SYNC_APP_MESSAGE_FOLDERS_MUTATION,\n variables: { input },\n caller: 'syncMessageFolders',\n });\n\n return syncAppMessageFolders;\n};\n","import {\n type RunAgentInput,\n type RunAgentResult,\n} from 'twenty-shared/application';\nimport { isDefined } from 'twenty-shared/utils';\n\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst RUN_AGENT_MUTATION = `\n mutation RunAgent($input: RunAgentInput!) {\n runAgent(input: $input) {\n threadId\n status\n result\n error\n success\n }\n }\n`;\n\nexport const runAgent = async ({\n input,\n ...rest\n}: RunAgentInput): Promise<RunAgentResult> => {\n const variables = {\n input: isDefined(input)\n ? {\n ...rest,\n input:\n typeof input === 'string'\n ? [{ role: 'user', content: input }]\n : input,\n }\n : rest,\n };\n\n const { runAgent: result } = await postGraphqlRequest<\n typeof variables,\n { runAgent: RunAgentResult }\n >({\n query: RUN_AGENT_MUTATION,\n variables,\n caller: 'runAgent',\n });\n\n return result;\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { type SendInboxMessageResult } from 'twenty-shared/application';\n\nimport { type SendInboxMessageInput } from '@/sdk/define/common/types/loose-shared-types.type';\n\nexport const sendInboxMessage = async (\n input: SendInboxMessageInput,\n): Promise<SendInboxMessageResult> => {\n const client = new MetadataApiClient();\n\n const { sendInboxMessage: result } = await client.mutation({\n sendInboxMessage: {\n __args: { input },\n threadId: true,\n },\n });\n\n return result;\n};\n","const OPENING_BRACKET_PATTERN = /\\[/g;\nconst CLOSING_BRACKET_PATTERN = /\\]/g;\nconst LINE_BREAK_PATTERN = /\\r?\\n/g;\n\nexport const sanitizeInboxReferenceLabel = (label: string): string =>\n label\n .replace(OPENING_BRACKET_PATTERN, '(')\n .replace(CLOSING_BRACKET_PATTERN, ')')\n .replace(LINE_BREAK_PATTERN, ' ')\n .trim();\n","import { isNonEmptyString } from '@sniptt/guards';\nimport { RestApiClient } from 'twenty-client-sdk/rest';\nimport { formatRecordReference } from 'twenty-shared/ai';\n\nimport { sanitizeInboxReferenceLabel } from '@/sdk/inbox/mentions/utils/sanitize-inbox-reference-label.util';\n\ntype WorkspaceMemberResponse = {\n data: {\n workspaceMember: {\n name: { firstName: string | null; lastName: string | null };\n userEmail: string;\n };\n };\n};\n\nexport const inboxMention = async ({\n workspaceMemberId,\n}: {\n workspaceMemberId: string;\n}): Promise<string> => {\n const {\n data: { workspaceMember },\n } = await new RestApiClient().get<WorkspaceMemberResponse>(\n `/rest/workspaceMembers/${workspaceMemberId}`,\n );\n\n const fullName =\n `${workspaceMember.name.firstName ?? ''} ${workspaceMember.name.lastName ?? ''}`.trim();\n\n return formatRecordReference({\n objectNameSingular: 'workspaceMember',\n recordId: workspaceMemberId,\n displayName: sanitizeInboxReferenceLabel(\n isNonEmptyString(fullName) ? fullName : workspaceMember.userEmail,\n ),\n });\n};\n","import { isObject, isString } from '@sniptt/guards';\nimport { isDefined } from 'twenty-shared/utils';\n\nimport { type InboxLabelIdentifierField } from '@/sdk/inbox/mentions/types/inbox-label-identifier-field.type';\n\nconst getFullNamePart = ({\n fullName,\n partName,\n}: {\n fullName: unknown;\n partName: 'firstName' | 'lastName';\n}): string => {\n const part = isObject(fullName) ? Reflect.get(fullName, partName) : undefined;\n\n return isString(part) ? part : '';\n};\n\nexport const computeInboxRecordLabel = ({\n record,\n recordId,\n labelIdentifierField,\n}: {\n record: Record<string, unknown>;\n recordId: string;\n labelIdentifierField: InboxLabelIdentifierField | undefined;\n}): string => {\n if (!isDefined(labelIdentifierField)) {\n return recordId;\n }\n\n const labelValue = record[labelIdentifierField.name];\n\n if (labelIdentifierField.type === 'FULL_NAME') {\n return `${getFullNamePart({ fullName: labelValue, partName: 'firstName' })} ${getFullNamePart({ fullName: labelValue, partName: 'lastName' })}`.trim();\n }\n\n return isDefined(labelValue) ? String(labelValue) : '';\n};\n","import { type MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { isDefined } from 'twenty-shared/utils';\n\nimport { type InboxLabelIdentifierField } from '@/sdk/inbox/mentions/types/inbox-label-identifier-field.type';\nimport { type InboxObjectMetadata } from '@/sdk/inbox/mentions/types/inbox-object-metadata.type';\n\nexport const findInboxLabelIdentifierField = async ({\n metadataClient,\n objectMetadata,\n}: {\n metadataClient: MetadataApiClient;\n objectMetadata: Pick<\n InboxObjectMetadata,\n 'id' | 'labelIdentifierFieldMetadataId'\n >;\n}): Promise<InboxLabelIdentifierField | undefined> => {\n if (!isDefined(objectMetadata.labelIdentifierFieldMetadataId)) {\n return undefined;\n }\n\n const { object } = await metadataClient.query({\n object: {\n __args: { id: objectMetadata.id },\n fields: {\n __args: {\n filter: { id: { eq: objectMetadata.labelIdentifierFieldMetadataId } },\n paging: { first: 1 },\n },\n edges: { node: { name: true, type: true } },\n },\n },\n });\n\n return object.fields.edges[0]?.node;\n};\n","import { type MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { isDefined } from 'twenty-shared/utils';\n\nimport { type InboxObjectMetadata } from '@/sdk/inbox/mentions/types/inbox-object-metadata.type';\n\nconst OBJECTS_PAGE_SIZE = 1000;\n\nexport const findInboxObjectMetadataOrThrow = async ({\n metadataClient,\n objectNameSingular,\n}: {\n metadataClient: MetadataApiClient;\n objectNameSingular: string;\n}): Promise<InboxObjectMetadata> => {\n const { objects } = await metadataClient.query({\n objects: {\n __args: { filter: {}, paging: { first: OBJECTS_PAGE_SIZE } },\n edges: {\n node: {\n id: true,\n nameSingular: true,\n namePlural: true,\n labelIdentifierFieldMetadataId: true,\n },\n },\n },\n });\n\n const objectMetadata = objects.edges.find(\n ({ node }) => node.nameSingular === objectNameSingular,\n )?.node;\n\n if (!isDefined(objectMetadata)) {\n throw new Error(`This workspace has no ${objectNameSingular} object.`);\n }\n\n return objectMetadata;\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { RestApiClient } from 'twenty-client-sdk/rest';\nimport { formatRecordReference } from 'twenty-shared/ai';\n\nimport { computeInboxRecordLabel } from '@/sdk/inbox/mentions/utils/compute-inbox-record-label.util';\nimport { findInboxLabelIdentifierField } from '@/sdk/inbox/mentions/utils/find-inbox-label-identifier-field.util';\nimport { findInboxObjectMetadataOrThrow } from '@/sdk/inbox/mentions/utils/find-inbox-object-metadata-or-throw.util';\nimport { sanitizeInboxReferenceLabel } from '@/sdk/inbox/mentions/utils/sanitize-inbox-reference-label.util';\n\nexport const inboxReferenceRecord = async ({\n objectNameSingular,\n recordId,\n}: {\n objectNameSingular: string;\n recordId: string;\n}): Promise<string> => {\n const metadataClient = new MetadataApiClient();\n const objectMetadata = await findInboxObjectMetadataOrThrow({\n metadataClient,\n objectNameSingular,\n });\n\n const [labelIdentifierField, recordResponse] = await Promise.all([\n findInboxLabelIdentifierField({ metadataClient, objectMetadata }),\n new RestApiClient().get<{\n data: Record<string, Record<string, unknown>>;\n }>(`/rest/${objectMetadata.namePlural}/${recordId}`),\n ]);\n\n return formatRecordReference({\n objectNameSingular,\n recordId,\n displayName: sanitizeInboxReferenceLabel(\n computeInboxRecordLabel({\n record: recordResponse.data[objectNameSingular],\n recordId,\n labelIdentifierField,\n }),\n ),\n });\n};\n","import {\n AGENT_CHAT_ASSISTANT_MENTION_OBJECT_NAME_SINGULAR,\n AGENT_CHAT_ASSISTANT_NAME,\n formatRecordReference,\n} from 'twenty-shared/ai';\n\nexport const INBOX_ASSISTANT_MENTION = formatRecordReference({\n objectNameSingular: AGENT_CHAT_ASSISTANT_MENTION_OBJECT_NAME_SINGULAR,\n recordId: AGENT_CHAT_ASSISTANT_MENTION_OBJECT_NAME_SINGULAR,\n displayName: AGENT_CHAT_ASSISTANT_NAME,\n});\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { type InboxThreadRecordInput } from 'twenty-shared/application';\n\nexport const attachRecordToInboxThread = async (\n input: InboxThreadRecordInput,\n): Promise<void> => {\n const client = new MetadataApiClient();\n\n await client.mutation({\n attachRecordToInboxThread: { __args: { input } },\n });\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { type InboxThreadRecordInput } from 'twenty-shared/application';\n\nexport const detachRecordFromInboxThread = async (\n input: InboxThreadRecordInput,\n): Promise<void> => {\n const client = new MetadataApiClient();\n\n await client.mutation({\n detachRecordFromInboxThread: { __args: { input } },\n });\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport {\n type EnqueueJobInput,\n type EnqueueJobResult,\n} from 'twenty-shared/application';\n\n/**\n * @deprecated Use `enqueueJobs` instead.\n */\nexport const enqueueJob = async (\n input: EnqueueJobInput,\n): Promise<EnqueueJobResult> => {\n const client = new MetadataApiClient();\n\n const { enqueueJob: result } = await client.mutation({\n enqueueJob: {\n __args: { input },\n enqueued: true,\n logicFunctionUniversalIdentifier: true,\n jobId: true,\n },\n });\n\n return result;\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport {\n type EnqueueJobsInput,\n type EnqueueJobsResult,\n} from 'twenty-shared/application';\n\nexport const enqueueJobs = async (\n input: EnqueueJobsInput,\n): Promise<EnqueueJobsResult> => {\n const client = new MetadataApiClient();\n\n const { enqueueJobs: result } = await client.mutation({\n enqueueJobs: {\n __args: { input },\n enqueued: true,\n logicFunctionUniversalIdentifier: true,\n enqueuedJobsCount: true,\n jobIds: true,\n },\n });\n\n return result;\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { type JobStatusResult } from 'twenty-shared/application';\n\nexport const getJobs = async (jobIds: string[]): Promise<JobStatusResult[]> => {\n const client = new MetadataApiClient();\n\n const { getJobs: result } = await client.query({\n getJobs: {\n __args: { jobIds },\n jobId: true,\n state: true,\n attemptsMade: true,\n failedReason: true,\n enqueuedAt: true,\n startedAt: true,\n finishedAt: true,\n },\n });\n\n return result;\n};\n","import { MetadataApiClient } from 'twenty-client-sdk/metadata';\nimport { RestApiClient } from 'twenty-client-sdk/rest';\nimport { capitalize, isDefined } from 'twenty-shared/utils';\nimport { type TimelineActivityTypeSnapshot } from 'twenty-shared/timeline';\n\ntype CreateTimelineActivityBaseInput = {\n timelineActivityTypeUniversalIdentifier: string;\n targetObjectUniversalIdentifier: string;\n targetRecordId: string;\n happensAt?: string;\n properties?: Record<string, unknown>;\n};\n\ntype CreateTimelineActivityLinkedRecordInput =\n | {\n linkedRecordId: string;\n linkedObjectMetadataUniversalIdentifier: string;\n }\n | {\n linkedRecordId?: never;\n linkedObjectMetadataUniversalIdentifier?: never;\n };\n\nexport type CreateTimelineActivityInput = CreateTimelineActivityBaseInput &\n CreateTimelineActivityLinkedRecordInput;\n\nexport type CreatedTimelineActivity = {\n id: string;\n timelineActivityTypeId: string;\n timelineActivityTypeSnapshot: TimelineActivityTypeSnapshot;\n};\n\nconst getObjectMetadataSelection = (universalIdentifiers: string[]) => ({\n __args: {\n paging: {\n first: universalIdentifiers.length,\n },\n filter: {\n universalIdentifier: {\n in: universalIdentifiers,\n },\n },\n },\n edges: {\n node: {\n id: true,\n universalIdentifier: true,\n nameSingular: true,\n },\n },\n});\n\n// Apps address manifest entities by universal identifier; the row stores the installation-specific metadata id\nexport const createTimelineActivity = async ({\n timelineActivityTypeUniversalIdentifier,\n targetObjectUniversalIdentifier,\n linkedObjectMetadataUniversalIdentifier,\n targetRecordId,\n ...input\n}: CreateTimelineActivityInput): Promise<CreatedTimelineActivity> => {\n const requiredObjectUniversalIdentifiers = [\n ...new Set(\n [\n targetObjectUniversalIdentifier,\n linkedObjectMetadataUniversalIdentifier,\n ].filter(isDefined),\n ),\n ];\n const metadataClient = new MetadataApiClient();\n const { timelineActivityTypes, objects } = await metadataClient.query({\n timelineActivityTypes: {\n id: true,\n universalIdentifier: true,\n isActive: true,\n },\n objects: getObjectMetadataSelection(requiredObjectUniversalIdentifiers),\n });\n\n const timelineActivityType = timelineActivityTypes.find(\n ({ universalIdentifier }) =>\n universalIdentifier === timelineActivityTypeUniversalIdentifier,\n );\n\n if (!isDefined(timelineActivityType)) {\n throw new Error(\n `Timeline activity type ${timelineActivityTypeUniversalIdentifier} is not installed`,\n );\n }\n\n if (!timelineActivityType.isActive) {\n throw new Error(\n `Timeline activity type ${timelineActivityTypeUniversalIdentifier} is inactive`,\n );\n }\n\n const objectMetadataByUniversalIdentifier = new Map(\n objects.edges.map(({ node }) => [node.universalIdentifier, node]),\n );\n\n const targetObject = objectMetadataByUniversalIdentifier.get(\n targetObjectUniversalIdentifier,\n );\n\n if (!isDefined(targetObject)) {\n throw new Error(\n `Timeline activity target object ${targetObjectUniversalIdentifier} is not installed`,\n );\n }\n\n const targetFieldName = `target${capitalize(targetObject.nameSingular)}Id`;\n const linkedObject = isDefined(linkedObjectMetadataUniversalIdentifier)\n ? objectMetadataByUniversalIdentifier.get(\n linkedObjectMetadataUniversalIdentifier,\n )\n : undefined;\n\n if (\n isDefined(linkedObjectMetadataUniversalIdentifier) &&\n !isDefined(linkedObject)\n ) {\n throw new Error(\n `Timeline activity linked object ${linkedObjectMetadataUniversalIdentifier} is not installed`,\n );\n }\n\n const response = await new RestApiClient().post<{\n data: { createTimelineActivity: CreatedTimelineActivity };\n }>('/rest/timelineActivities', {\n ...input,\n timelineActivityTypeId: timelineActivityType.id,\n linkedObjectMetadataId: linkedObject?.id,\n [targetFieldName]: targetRecordId,\n });\n\n return response.data.createTimelineActivity;\n};\n","import {\n type AppKeyValue,\n type AppKeyValueScope,\n} from 'twenty-shared/application';\n\nimport { postGraphqlRequest } from '@/sdk/logic-function/utils/post-graphql-request.util';\n\nconst GET_APP_KEY_VALUE_QUERY = `\n query GetAppKeyValue($key: String!, $scope: AppKeyValueScope) {\n appKeyValue(key: $key, scope: $scope) {\n key\n value\n scope\n }\n }\n`;\n\nconst SET_APP_KEY_VALUE_MUTATION = `\n mutation SetAppKeyValue($input: SetAppKeyValueInput!) {\n setAppKeyValue(input: $input) {\n key\n value\n scope\n }\n }\n`;\n\nconst DELETE_APP_KEY_VALUE_MUTATION = `\n mutation DeleteAppKeyValue($key: String!, $scope: AppKeyValueScope) {\n deleteAppKeyValue(key: $key, scope: $scope)\n }\n`;\n\nconst DEFAULT_APP_KEY_VALUE_SCOPE: AppKeyValueScope = 'WORKSPACE';\n\ntype KvOptions = {\n scope?: AppKeyValueScope;\n};\n\nexport const kv = {\n async get<TValue = unknown>(\n key: string,\n options?: KvOptions,\n ): Promise<TValue | null> {\n const { appKeyValue } = await postGraphqlRequest<\n { key: string; scope: AppKeyValueScope },\n { appKeyValue: AppKeyValue | null }\n >({\n query: GET_APP_KEY_VALUE_QUERY,\n variables: { key, scope: options?.scope ?? DEFAULT_APP_KEY_VALUE_SCOPE },\n caller: 'kv.get',\n });\n\n return (appKeyValue?.value ?? null) as TValue | null;\n },\n\n async set<TValue>(\n key: string,\n value: TValue,\n options?: KvOptions,\n ): Promise<void> {\n await postGraphqlRequest<\n {\n input: { key: string; value: TValue; scope: AppKeyValueScope };\n },\n { setAppKeyValue: AppKeyValue }\n >({\n query: SET_APP_KEY_VALUE_MUTATION,\n variables: {\n input: {\n key,\n value,\n scope: options?.scope ?? DEFAULT_APP_KEY_VALUE_SCOPE,\n },\n },\n caller: 'kv.set',\n });\n },\n\n async delete(key: string, options?: KvOptions): Promise<boolean> {\n const { deleteAppKeyValue } = await postGraphqlRequest<\n { key: string; scope: AppKeyValueScope },\n { deleteAppKeyValue: boolean }\n >({\n query: DELETE_APP_KEY_VALUE_MUTATION,\n variables: { key, scope: options?.scope ?? DEFAULT_APP_KEY_VALUE_SCOPE },\n caller: 'kv.delete',\n });\n\n return deleteAppKeyValue;\n },\n};\n","import { type LogicFunctionHttpResponse } from 'twenty-shared/types';\n\nexport type ResponseInit = {\n status?: number;\n headers?: Record<string, string>;\n};\n\nexport class Response implements LogicFunctionHttpResponse {\n readonly __twentyHttpResponse = true as const;\n readonly body: unknown;\n readonly status?: number;\n readonly headers?: Record<string, string>;\n\n constructor(body: unknown, init?: ResponseInit) {\n this.body = body;\n this.status = init?.status;\n this.headers = init?.headers;\n }\n}\n"],"mappings":"+KAEA,IAAIA,EAAK,GAAM,EAAA,EAAA,EAAA,YAAA,CAAG,CAAC,GAAK,EAAA,EAAA,EAAA,OAAA,CAAG,CAAC,ECsBzBC,EAAK,GAAM,CACb,IAAI,EAAI,CAAE,KAAM,SAAU,EAC1B,OAAQ,EAAE,KAAV,CACC,IAAK,SACJ,EAAE,KAAO,SACT,MACD,IAAK,SACL,IAAK,UACJ,EAAE,KAAO,SACT,MACD,IAAK,UACJ,EAAE,KAAO,UACT,MACD,IAAK,QACJ,EAAE,KAAO,QAAS,EAAE,QAAU,EAAE,MAAQA,EAAE,EAAE,KAAK,GACjD,MACD,IAAK,SACJ,EAAE,KAAO,SAAU,EAAE,aAAe,EAAE,WAAa,OAAO,YAAY,OAAO,QAAQ,EAAE,UAAU,CAAC,CAAC,KAAK,CAAC,EAAG,KAAO,CAAC,EAAGA,EAAE,CAAC,CAAC,CAAC,CAAC,GAC7H,MACD,IAAK,SACJ,EAAE,KAAO,SACT,MACD,IAAK,UACJ,EAAE,KAAO,UACT,MACD,QAAS,EAAE,KAAO,SACnB,CACA,OAAO,MAAM,QAAQ,EAAE,IAAI,IAAM,EAAE,KAAO,EAAE,KAAK,OAAQ,GAAM,OAAO,GAAK,QAAQ,GAAI,EAAE,YAAc,CAAC,IAAM,EAAE,UAAY,CAAC,IAAA,EAAA,EAAA,iBAAA,CAAM,EAAE,KAAK,IAAM,EAAE,MAAQ,EAAE,QAAA,EAAA,EAAA,iBAAA,CAAU,EAAE,yBAAyB,IAAM,EAAE,0BAA4B,EAAE,2BAA4B,CACpQ,EAAG,EAAK,GAAM,CAACA,EAAE,CAAC,CAAC,EAAsB,EAAE,CAC1C,KAAM,SACN,WAAY,CACX,EAAG,CAAE,KAAM,QAAS,EACpB,EAAG,CAAE,KAAM,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InboxThreadRecordInput = {
|
|
2513
|
+
threadId: string;
|
|
2514
|
+
objectNameSingular: string;
|
|
2515
|
+
recordId: string;
|
|
2516
|
+
};
|
|
2517
|
+
|
|
2512
2518
|
declare const TIMELINE_ACTIVITY_ACTIONS: readonly ["created", "updated", "deleted", "restored", "linked", "unlinked"];
|
|
2513
2519
|
type TimelineActivityAction = (typeof TIMELINE_ACTIVITY_ACTIONS)[number];
|
|
2514
2520
|
|
|
@@ -2914,6 +2920,10 @@ declare const inboxReferenceRecord: ({ objectNameSingular, recordId, }: {
|
|
|
2914
2920
|
|
|
2915
2921
|
declare const INBOX_ASSISTANT_MENTION: string;
|
|
2916
2922
|
|
|
2923
|
+
declare const attachRecordToInboxThread: (input: InboxThreadRecordInput) => Promise<void>;
|
|
2924
|
+
|
|
2925
|
+
declare const detachRecordFromInboxThread: (input: InboxThreadRecordInput) => Promise<void>;
|
|
2926
|
+
|
|
2917
2927
|
/**
|
|
2918
2928
|
* @deprecated Use `enqueueJobs` instead.
|
|
2919
2929
|
*/
|
|
@@ -2966,5 +2976,5 @@ declare class Response implements LogicFunctionHttpResponse {
|
|
|
2966
2976
|
constructor(body: unknown, init?: ResponseInit);
|
|
2967
2977
|
}
|
|
2968
2978
|
|
|
2969
|
-
export { AppConnectionAuthFailedError, INBOX_ASSISTANT_MENTION, ObjectRecordBaseEvent, ObjectRecordCreateEvent, ObjectRecordDeleteEvent, ObjectRecordDestroyEvent, ObjectRecordRestoreEvent, ObjectRecordUpdateEvent, ObjectRecordUpsertEvent, Response, RetryableLogicFunctionError, createMessageChannel, createTimelineActivity, deleteMessageChannel, enqueueJob, enqueueJobs, findConnectionForRequest, getConnection, getJobs, inboxMention, inboxReferenceRecord, ingestMessages, jsonSchemaToInputSchema, kv, listConnections, listMessageChannels, listMessageFolders, reportConnectionAuthFailure, runAgent, sendInboxMessage, syncMessageFolders, updateMessageChannel };
|
|
2970
|
-
export type { AppConnection, AppKeyValue, AppKeyValueScope, AppMessageChannel, AppMessageFolder, AuthorizeConnectionPayload, AuthorizeConnectionResult, ConnectionCallbackPayload, ConnectionCallbackResult, CreateMessageChannelInput, CreateTimelineActivityInput, CreatedTimelineActivity, CronPayload, DatabaseEventBatchPayload, DatabaseEventPayload, EnqueueJobInput, EnqueueJobItem, EnqueueJobOptions, EnqueueJobResult, EnqueueJobsInput, EnqueueJobsResult, IdentifyAccountPayload, IdentifyAccountResult, IngestMessage, IngestMessageParticipant, IngestedMessage, InputJsonSchema, InstallHandler, InstallPayload, JobStatusResult, JobStatusState, ListConnectionsFilter, ListMessageChannelsFilter, ListMessageFoldersFilter, LogicFunctionConfig, LogicFunctionExecutionContext, LogicFunctionHandler, ObjectRecordEvent, ResponseInit, LogicFunctionEvent as RoutePayload, RunAgentInput, RunAgentResult, SendAppMessagePayload, SendAppMessageRecipient, SendAppMessageResult, SendInboxMessageInput, SendInboxMessageResult, ServerRouteDispatchResult, ServerRouteResolverResult, SyncMessageFoldersInput, UninstallHandler, UninstallPayload, UpdateMessageChannelInput };
|
|
2979
|
+
export { AppConnectionAuthFailedError, INBOX_ASSISTANT_MENTION, ObjectRecordBaseEvent, ObjectRecordCreateEvent, ObjectRecordDeleteEvent, ObjectRecordDestroyEvent, ObjectRecordRestoreEvent, ObjectRecordUpdateEvent, ObjectRecordUpsertEvent, Response, RetryableLogicFunctionError, attachRecordToInboxThread, createMessageChannel, createTimelineActivity, deleteMessageChannel, detachRecordFromInboxThread, enqueueJob, enqueueJobs, findConnectionForRequest, getConnection, getJobs, inboxMention, inboxReferenceRecord, ingestMessages, jsonSchemaToInputSchema, kv, listConnections, listMessageChannels, listMessageFolders, reportConnectionAuthFailure, runAgent, sendInboxMessage, syncMessageFolders, updateMessageChannel };
|
|
2980
|
+
export type { AppConnection, AppKeyValue, AppKeyValueScope, AppMessageChannel, AppMessageFolder, AuthorizeConnectionPayload, AuthorizeConnectionResult, ConnectionCallbackPayload, ConnectionCallbackResult, CreateMessageChannelInput, CreateTimelineActivityInput, CreatedTimelineActivity, CronPayload, DatabaseEventBatchPayload, DatabaseEventPayload, EnqueueJobInput, EnqueueJobItem, EnqueueJobOptions, EnqueueJobResult, EnqueueJobsInput, EnqueueJobsResult, IdentifyAccountPayload, IdentifyAccountResult, InboxThreadRecordInput, IngestMessage, IngestMessageParticipant, IngestedMessage, InputJsonSchema, InstallHandler, InstallPayload, JobStatusResult, JobStatusState, ListConnectionsFilter, ListMessageChannelsFilter, ListMessageFoldersFilter, LogicFunctionConfig, LogicFunctionExecutionContext, LogicFunctionHandler, ObjectRecordEvent, ResponseInit, LogicFunctionEvent as RoutePayload, RunAgentInput, RunAgentResult, SendAppMessagePayload, SendAppMessageRecipient, SendAppMessageResult, SendInboxMessageInput, SendInboxMessageResult, ServerRouteDispatchResult, ServerRouteResolverResult, SyncMessageFoldersInput, UninstallHandler, UninstallPayload, UpdateMessageChannelInput };
|
|
@@ -201,9 +201,9 @@ var u = "RetryableLogicFunctionError", d = class extends Error {
|
|
|
201
201
|
caller: "syncMessageFolders"
|
|
202
202
|
});
|
|
203
203
|
return t;
|
|
204
|
-
},
|
|
204
|
+
}, W = "\n mutation RunAgent($input: RunAgentInput!) {\n runAgent(input: $input) {\n threadId\n status\n result\n error\n success\n }\n }\n", G = async ({ input: e, ...t }) => {
|
|
205
205
|
let { runAgent: n } = await y({
|
|
206
|
-
query:
|
|
206
|
+
query: W,
|
|
207
207
|
variables: { input: s(e) ? {
|
|
208
208
|
...t,
|
|
209
209
|
input: typeof e == "string" ? [{
|
|
@@ -214,13 +214,13 @@ var u = "RetryableLogicFunctionError", d = class extends Error {
|
|
|
214
214
|
caller: "runAgent"
|
|
215
215
|
});
|
|
216
216
|
return n;
|
|
217
|
-
},
|
|
217
|
+
}, K = async (e) => {
|
|
218
218
|
let { sendInboxMessage: t } = await new a().mutation({ sendInboxMessage: {
|
|
219
219
|
__args: { input: e },
|
|
220
220
|
threadId: !0
|
|
221
221
|
} });
|
|
222
222
|
return t;
|
|
223
|
-
},
|
|
223
|
+
}, q = /\[/g, ne = /\]/g, J = /\r?\n/g, Y = (e) => e.replace(q, "(").replace(ne, ")").replace(J, " ").trim(), X = async ({ workspaceMemberId: t }) => {
|
|
224
224
|
let { data: { workspaceMember: n } } = await new o().get(`/rest/workspaceMembers/${t}`), r = `${n.name.firstName ?? ""} ${n.name.lastName ?? ""}`.trim();
|
|
225
225
|
return C({
|
|
226
226
|
objectNameSingular: "workspaceMember",
|
|
@@ -293,6 +293,10 @@ var u = "RetryableLogicFunctionError", d = class extends Error {
|
|
|
293
293
|
recordId: S,
|
|
294
294
|
displayName: "Ada"
|
|
295
295
|
}), le = async (e) => {
|
|
296
|
+
await new a().mutation({ attachRecordToInboxThread: { __args: { input: e } } });
|
|
297
|
+
}, ue = async (e) => {
|
|
298
|
+
await new a().mutation({ detachRecordFromInboxThread: { __args: { input: e } } });
|
|
299
|
+
}, de = async (e) => {
|
|
296
300
|
let { enqueueJob: t } = await new a().mutation({ enqueueJob: {
|
|
297
301
|
__args: { input: e },
|
|
298
302
|
enqueued: !0,
|
|
@@ -300,7 +304,7 @@ var u = "RetryableLogicFunctionError", d = class extends Error {
|
|
|
300
304
|
jobId: !0
|
|
301
305
|
} });
|
|
302
306
|
return t;
|
|
303
|
-
},
|
|
307
|
+
}, fe = async (e) => {
|
|
304
308
|
let { enqueueJobs: t } = await new a().mutation({ enqueueJobs: {
|
|
305
309
|
__args: { input: e },
|
|
306
310
|
enqueued: !0,
|
|
@@ -309,7 +313,7 @@ var u = "RetryableLogicFunctionError", d = class extends Error {
|
|
|
309
313
|
jobIds: !0
|
|
310
314
|
} });
|
|
311
315
|
return t;
|
|
312
|
-
},
|
|
316
|
+
}, pe = async (e) => {
|
|
313
317
|
let { getJobs: t } = await new a().query({ getJobs: {
|
|
314
318
|
__args: { jobIds: e },
|
|
315
319
|
jobId: !0,
|
|
@@ -321,7 +325,7 @@ var u = "RetryableLogicFunctionError", d = class extends Error {
|
|
|
321
325
|
finishedAt: !0
|
|
322
326
|
} });
|
|
323
327
|
return t;
|
|
324
|
-
},
|
|
328
|
+
}, me = (e) => ({
|
|
325
329
|
__args: {
|
|
326
330
|
paging: { first: e.length },
|
|
327
331
|
filter: { universalIdentifier: { in: e } }
|
|
@@ -331,14 +335,14 @@ var u = "RetryableLogicFunctionError", d = class extends Error {
|
|
|
331
335
|
universalIdentifier: !0,
|
|
332
336
|
nameSingular: !0
|
|
333
337
|
} }
|
|
334
|
-
}),
|
|
338
|
+
}), Q = async ({ timelineActivityTypeUniversalIdentifier: e, targetObjectUniversalIdentifier: t, linkedObjectMetadataUniversalIdentifier: n, targetRecordId: r, ...i }) => {
|
|
335
339
|
let c = [...new Set([t, n].filter(s))], { timelineActivityTypes: l, objects: u } = await new a().query({
|
|
336
340
|
timelineActivityTypes: {
|
|
337
341
|
id: !0,
|
|
338
342
|
universalIdentifier: !0,
|
|
339
343
|
isActive: !0
|
|
340
344
|
},
|
|
341
|
-
objects:
|
|
345
|
+
objects: me(c)
|
|
342
346
|
}), d = l.find(({ universalIdentifier: t }) => t === e);
|
|
343
347
|
if (!s(d)) throw Error(`Timeline activity type ${e} is not installed`);
|
|
344
348
|
if (!d.isActive) throw Error(`Timeline activity type ${e} is inactive`);
|
|
@@ -352,10 +356,10 @@ var u = "RetryableLogicFunctionError", d = class extends Error {
|
|
|
352
356
|
linkedObjectMetadataId: h?.id,
|
|
353
357
|
[m]: r
|
|
354
358
|
})).data.createTimelineActivity;
|
|
355
|
-
},
|
|
359
|
+
}, he = "\n query GetAppKeyValue($key: String!, $scope: AppKeyValueScope) {\n appKeyValue(key: $key, scope: $scope) {\n key\n value\n scope\n }\n }\n", ge = "\n mutation SetAppKeyValue($input: SetAppKeyValueInput!) {\n setAppKeyValue(input: $input) {\n key\n value\n scope\n }\n }\n", _e = "\n mutation DeleteAppKeyValue($key: String!, $scope: AppKeyValueScope) {\n deleteAppKeyValue(key: $key, scope: $scope)\n }\n", $ = "WORKSPACE", ve = {
|
|
356
360
|
async get(e, t) {
|
|
357
361
|
let { appKeyValue: n } = await y({
|
|
358
|
-
query:
|
|
362
|
+
query: he,
|
|
359
363
|
variables: {
|
|
360
364
|
key: e,
|
|
361
365
|
scope: t?.scope ?? $
|
|
@@ -366,7 +370,7 @@ var u = "RetryableLogicFunctionError", d = class extends Error {
|
|
|
366
370
|
},
|
|
367
371
|
async set(e, t, n) {
|
|
368
372
|
await y({
|
|
369
|
-
query:
|
|
373
|
+
query: ge,
|
|
370
374
|
variables: { input: {
|
|
371
375
|
key: e,
|
|
372
376
|
value: t,
|
|
@@ -377,7 +381,7 @@ var u = "RetryableLogicFunctionError", d = class extends Error {
|
|
|
377
381
|
},
|
|
378
382
|
async delete(e, t) {
|
|
379
383
|
let { deleteAppKeyValue: n } = await y({
|
|
380
|
-
query:
|
|
384
|
+
query: _e,
|
|
381
385
|
variables: {
|
|
382
386
|
key: e,
|
|
383
387
|
scope: t?.scope ?? $
|
|
@@ -386,12 +390,12 @@ var u = "RetryableLogicFunctionError", d = class extends Error {
|
|
|
386
390
|
});
|
|
387
391
|
return n;
|
|
388
392
|
}
|
|
389
|
-
},
|
|
393
|
+
}, ye = class {
|
|
390
394
|
constructor(e, t) {
|
|
391
395
|
this.__twentyHttpResponse = !0, this.body = e, this.status = t?.status, this.headers = t?.headers;
|
|
392
396
|
}
|
|
393
397
|
};
|
|
394
398
|
//#endregion
|
|
395
|
-
export { f as AppConnectionAuthFailedError, ce as INBOX_ASSISTANT_MENTION,
|
|
399
|
+
export { f as AppConnectionAuthFailedError, ce as INBOX_ASSISTANT_MENTION, ye as Response, d as RetryableLogicFunctionError, le as attachRecordToInboxThread, A as createMessageChannel, Q as createTimelineActivity, I as deleteMessageChannel, ue as detachRecordFromInboxThread, de as enqueueJob, fe as enqueueJobs, T as findConnectionForRequest, x as getConnection, pe as getJobs, X as inboxMention, se as inboxReferenceRecord, R as ingestMessages, l as jsonSchemaToInputSchema, ve as kv, w as listConnections, M as listMessageChannels, V as listMessageFolders, D as reportConnectionAuthFailure, G as runAgent, K as sendInboxMessage, U as syncMessageFolders, P as updateMessageChannel };
|
|
396
400
|
|
|
397
401
|
//# sourceMappingURL=index.mjs.map
|