@cognite/cli 1.8.0-alpha.sdk-gen → 1.9.0-alpha.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/_templates/agents/create/EVAL_CASES_TEMPLATE.yaml +68 -0
- package/_templates/agents/create/README_TEMPLATE.md +12 -0
- package/_templates/app/new/root/.npmrc.ejs.t +1 -1
- package/_templates/app/new/root/AGENTS.md.ejs.t +14 -62
- package/_templates/app/new/root/SPEC.md.ejs.t +15 -17
- package/_templates/app/new/root/app.json.ejs.t +0 -1
- package/_templates/app/new/root/manifest.json.ejs.t +1 -6
- package/_templates/app/new/root/package.json.ejs.t +5 -8
- package/_templates/app/new/src/App.tsx.ejs.t +10 -6
- package/dist/chunk-P2OHSI4O.js +12 -0
- package/dist/cli/cli.js +94 -210
- package/dist/deploy/index.d.ts +6 -1
- package/dist/deploy/index.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/package.json +7 -15
- package/dist/chunk-ATR2SGLU.js +0 -1
- package/dist/chunk-M3FWAJ4N.js +0 -12
- package/dist/chunk-PZ2YS5FR.js +0 -1
- package/dist/sdk-runtime/index.d.ts +0 -371
- package/dist/sdk-runtime/index.js +0 -1
package/dist/deploy/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ interface AppMetadata {
|
|
|
31
31
|
name: string;
|
|
32
32
|
description?: string;
|
|
33
33
|
}
|
|
34
|
-
declare const SIGNATURE_STATUSES: readonly ["VALID", "REVOKED", "EXPIRED", "SIGNED_BEFORE_KEY_ISSUED", "IAT_IN_FUTURE", "BUNDLE_TOO_OLD", "KEY_NOT_IN_REGISTRY"];
|
|
34
|
+
declare const SIGNATURE_STATUSES: readonly ["VALID", "REVOKED", "EXPIRED", "SIGNED_BEFORE_KEY_ISSUED", "IAT_IN_FUTURE", "BUNDLE_TOO_OLD", "KEY_NOT_IN_REGISTRY", "SCOPE_MISMATCH", "VERIFICATION_FAILED"];
|
|
35
35
|
type SignatureStatus = (typeof SIGNATURE_STATUSES)[number];
|
|
36
36
|
declare const SIGNER_ROLES: readonly ["developer", "certifier"];
|
|
37
37
|
type SignerRole = (typeof SIGNER_ROLES)[number];
|
|
@@ -212,6 +212,11 @@ declare class SensitiveString {
|
|
|
212
212
|
[inspect.custom](): string;
|
|
213
213
|
/** Returns the raw value. Only call this at a trusted boundary. */
|
|
214
214
|
expose(): string;
|
|
215
|
+
/**
|
|
216
|
+
* Value-equality with another secret, without exposing either. `expose()` is
|
|
217
|
+
* reserved for external boundaries, and an in-process comparison is not one.
|
|
218
|
+
*/
|
|
219
|
+
equals(other: SensitiveString): boolean;
|
|
215
220
|
/** Creates a {@link SensitiveString} wrapping `value`. */
|
|
216
221
|
static from(value: string): SensitiveString;
|
|
217
222
|
}
|
package/dist/deploy/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"../chunk-P2OHSI4O.js";export{a as AppHostingClient,b as ApplicationPackager,c as BUNDLE_DIR,h as SIGNATURE_SUFFIXES,d as bundleFileName,e as bundlePath,l as deploy,m as deployBundle,i as discoverSignatures,g as getSdk,f as getToken,j as packageBundle,k as uploadBundle};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { App, AppHostingClient, ApplicationPackager, BUNDLE_DIR, Deployment, SIGNATURE_SUFFIXES, bundleFileName, bundlePath, deploy, deployBundle, discoverSignatures, getSdk, getToken, packageBundle, uploadBundle } from './deploy/index.js';
|
|
2
|
-
export { AggregateArgs, AggregateMethod, AggregateRequest, AggregateRow, ArrayElementOf, CountArgs, CountMethod, DetailSelectArg, GetByIdArgs, GetByIdMethod, ListItemOf, ListMethod, OpKind, PageInfoOf, PartialDetailResult, PartialListResult, QueryArgs, SdkDispatcher, SdkRuntime, SearchArgs, SelectArg, SelectArgs, SortInput, ViewDefinition, ViewDefinitionProperty, WithArg, WithSelection, createSdkDispatcher, createSdkRuntime, createSdkRuntimeFromViews } from './sdk-runtime/index.js';
|
|
3
2
|
import '@cognite/sdk';
|
|
4
3
|
import 'node:util';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g}from"./chunk-
|
|
1
|
+
import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g}from"./chunk-P2OHSI4O.js";export{o as AppHostingClient,r as ApplicationPackager,e as BUNDLE_DIR,x as SIGNATURE_SUFFIXES,f as bundleFileName,m as bundlePath,d as deploy,g as deployBundle,a as discoverSignatures,t as getSdk,p as getToken,b as packageBundle,c as uploadBundle};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognite/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0-alpha.0",
|
|
4
4
|
"description": "CLI for Cognite Data Fusion",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Cognite",
|
|
@@ -22,11 +22,6 @@
|
|
|
22
22
|
"types": "./dist/deploy/index.d.ts",
|
|
23
23
|
"import": "./dist/deploy/index.js",
|
|
24
24
|
"default": "./dist/deploy/index.js"
|
|
25
|
-
},
|
|
26
|
-
"./sdk-runtime": {
|
|
27
|
-
"types": "./dist/sdk-runtime/index.d.ts",
|
|
28
|
-
"import": "./dist/sdk-runtime/index.js",
|
|
29
|
-
"default": "./dist/sdk-runtime/index.js"
|
|
30
25
|
}
|
|
31
26
|
},
|
|
32
27
|
"bin": {
|
|
@@ -52,23 +47,20 @@
|
|
|
52
47
|
"refresh-spec-kit": "bash scripts/refresh-spec-kit.sh"
|
|
53
48
|
},
|
|
54
49
|
"dependencies": {
|
|
50
|
+
"@ai-sdk/provider": "^2.0.0",
|
|
51
|
+
"@arizeai/phoenix-evals": "^1.0.3",
|
|
55
52
|
"@cognite/app-sdk": "^0.8.0",
|
|
56
53
|
"@cognite/sdk": "^10.10.0",
|
|
57
|
-
"@graphql-codegen/add": "^7.0.1",
|
|
58
|
-
"@graphql-codegen/cli": "^7.0.0",
|
|
59
|
-
"@graphql-codegen/typescript": "^6.0.1",
|
|
60
|
-
"@graphql-codegen/typescript-document-nodes": "^6.0.1",
|
|
61
|
-
"@graphql-codegen/typescript-operations": "^6.0.2",
|
|
62
54
|
"@napi-rs/keyring": "^1.3.0",
|
|
63
55
|
"@sentry/node": "^10.51.0",
|
|
64
56
|
"@zip.js/zip.js": "^2.7.0",
|
|
57
|
+
"ai": "^5.0.0",
|
|
65
58
|
"chalk": "^5.6.2",
|
|
66
59
|
"clipboardy": "5.3.1",
|
|
67
60
|
"commander": "^15.0.0",
|
|
68
61
|
"dotenv": "^17.4.2",
|
|
69
62
|
"enquirer": "^2.4.1",
|
|
70
63
|
"execa": "^5.1.1",
|
|
71
|
-
"graphql": "^16.14.0",
|
|
72
64
|
"hygen": "^6.2.11",
|
|
73
65
|
"jose": "^6.2.2",
|
|
74
66
|
"mixpanel": "^0.22.0",
|
|
@@ -108,10 +100,10 @@
|
|
|
108
100
|
"react-dom": "^19.2.6",
|
|
109
101
|
"tsup": "^8.4.0",
|
|
110
102
|
"typescript": "^5.0.0",
|
|
111
|
-
"@vitest/coverage-v8": "4.1.
|
|
112
|
-
"vitest": "4.1.
|
|
103
|
+
"@vitest/coverage-v8": "4.1.9",
|
|
104
|
+
"vitest": "4.1.9"
|
|
113
105
|
},
|
|
114
106
|
"engines": {
|
|
115
|
-
"node": ">=20"
|
|
107
|
+
"node": ">=20 <22.23.0 || >=22.23.1 <24.17.0 || >=24.18.0 <26.3.1 || >=26.4.0"
|
|
116
108
|
}
|
|
117
109
|
}
|
package/dist/chunk-ATR2SGLU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var g=Object.defineProperty;var e=a=>{throw TypeError(a)};var h=(a,b)=>g(a,"name",{value:b,configurable:!0});var f=(a,b,c)=>b.has(a)||e("Cannot "+c);var i=(a,b,c)=>(f(a,b,"read from private field"),c?c.call(a):b.get(a)),j=(a,b,c)=>b.has(a)?e("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),k=(a,b,c,d)=>(f(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c);export{h as a,i as b,j as c,k as d};
|
package/dist/chunk-M3FWAJ4N.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{a as s,b as ne,c as re,d as ie}from"./chunk-ATR2SGLU.js";import{existsSync as ot}from"fs";import{mkdir as at,readFile as pt}from"fs/promises";import{basename as ct,dirname as dt}from"path";var H=class H extends Error{constructor(e,t={}){super(e),this.name="HintedError",t.cause!==void 0&&(this.cause=t.cause);let r=this.deriveDefaults(t);this.hint=t.hint??r.hint,this.helpUrl=t.helpUrl??r.helpUrl,this.shouldReport=t.shouldReport??!0}deriveDefaults(e){return{hint:xe(e.cause)}}};s(H,"HintedError");var l=H;var se="https://docs.cognite.com/cdf/access/",Ae="https://status.cognite.com";function ve(n){switch(n){case 401:return{hint:"Your credentials are invalid or expired. Check your client ID and secret.",helpUrl:se};case 403:return{hint:"You don't have the required CDF capabilities. Please contact your CDF admin.",helpUrl:se};case 413:return{hint:"The deployment exceeds the App Hosting size limit. Reduce the build output \u2014 remove unused assets, code-split bundles, or strip source maps."};case 429:return{hint:"You are being rate limited. Wait a few moments and retry. If this persists, contact CDF support."};case 500:case 502:case 503:case 504:return{hint:"CDF service error. The issue is on the server side. Check the status page and retry shortly.",helpUrl:Ae};default:return{}}}s(ve,"defaultHintForStatus");var L=class L extends l{constructor(e,t){super(e,t),this.name="HintedHttpError",this.httpStatusCode=t.httpStatusCode,this.requestUrl=t.requestUrl,this.responseBody=t.responseBody}deriveDefaults(e){let{httpStatusCode:t}=e,r=ve(t),i=super.deriveDefaults(e);return{hint:r.hint??i.hint,helpUrl:r.helpUrl}}};s(L,"HintedHttpError");var v=L;function ke(n,e){if(n)switch(n){case"ENOTFOUND":return e.hostname?`DNS lookup failed for ${e.hostname}. Check your network, VPN, or proxy settings.`:"DNS lookup failed. Check your network, VPN, or proxy settings.";case"ECONNREFUSED":return e.hostname&&e.port?`Connection refused by ${e.hostname}:${e.port}. The service may be down or the port may be wrong.`:"Connection refused. The service may be down or the port may be wrong.";case"ECONNRESET":return"Connection was reset. The server closed the connection unexpectedly; check for proxy/firewall interference and retry.";case"ETIMEDOUT":return"Connection timed out. Check your network, VPN, or proxy settings, and retry.";case"EAI_AGAIN":return"Temporary DNS failure. Retry shortly; if it persists, check your DNS configuration.";case"CERT_HAS_EXPIRED":case"UNABLE_TO_VERIFY_LEAF_SIGNATURE":case"SELF_SIGNED_CERT_IN_CHAIN":return"TLS certificate validation failed. Check system clock and CA trust store; if you use a corporate proxy, ensure its root cert is trusted.";case"EACCES":return e.path?`Permission denied: ${e.path}. Check file ownership and permissions.`:"Permission denied. Check file ownership and permissions.";case"ENOENT":return e.path?`File or directory not found: ${e.path}.`:"File or directory not found.";case"EISDIR":return e.path?`Expected a file but found a directory: ${e.path}.`:"Expected a file but found a directory.";case"ENOSPC":return"No space left on device. Free up disk space and retry.";case"EADDRINUSE":return e.port?`Port ${e.port} is already in use. Stop the process using it or pick a different port.`:"Address is already in use. Stop the conflicting process or change the port.";case"EMFILE":case"ENFILE":return"Too many open files. Close other programs or raise the file descriptor limit.";default:return}}s(ke,"hintForErrno");function xe(n){let e=n,t=new Set;for(;e!=null&&!t.has(e)&&(t.add(e),typeof e=="object");){let r=e,i=ke(r.code,r);if(i!==void 0)return i;e=r.cause}}s(xe,"hintForCause");import{inspect as Ie}from"util";var M="[REDACTED]",I,R=class R{constructor(e){re(this,I);ie(this,I,e)}toString(){return M}toJSON(){return M}[Ie.custom](){return M}expose(){return ne(this,I)}static from(e){return new R(e)}};I=new WeakMap,s(R,"SensitiveString");var w=R;var oe="https://docs.cognite.com/cdf/access/";function g(n){return n!==null&&typeof n=="object"}s(g,"isRecord");function P(n){return n instanceof Error&&"status"in n&&typeof n.status=="number"}s(P,"isHttpError");function Pe(n){switch(n){case 401:return`Your credentials are invalid or expired. Check your client ID and secret.
|
|
2
|
-
See: ${oe}`;case 403:return`You don't have the required CDF capabilities. Please contact your CDF admin.
|
|
3
|
-
See: ${oe}`;default:return}}s(Pe,"httpStatusHint");function h(n){let e=n instanceof Error?n:new Error(String(n));if(!P(e))return null;let t=Pe(e.status);return t?Object.assign(new Error(`${e.message}
|
|
4
|
-
${t}`),{cause:e}):null}s(h,"enrichedHttpError");function Ce(n){if(!g(n))return null;let e=n.missing;if(Array.isArray(e))return e;let t=n.data;if(g(t)){let r=t.error;if(g(r)&&Array.isArray(r.missing))return r.missing;if(Array.isArray(t.missing))return t.missing}return null}s(Ce,"findMissingArray");function Te(n,e){if(!P(n)||n.status!==400)return!1;let t=Ce(n);return t?t.some(r=>g(r)&&typeof r.externalId=="string"&&e.includes(r.externalId)):!1}s(Te,"isMissingExternalIdError");function D(n,e){return P(n)&&n.status===404||Te(n,e)}s(D,"isNotFoundError");var pe=["DRAFT","PUBLISHED","DEPRECATED","ARCHIVED"],ce=["ACTIVE","PREVIEW"],j=class j extends Error{constructor(e,t){super(`Version ${t} of app ${e} not found`),this.name="AppVersionNotFoundError",this.appExternalId=e,this.version=t}};s(j,"AppVersionNotFoundError");var $=j,G=class G extends Error{constructor(e){super(`App ${e} not found`),this.name="AppNotFoundError",this.appExternalId=e}};s(G,"AppNotFoundError");var U=G;function V(n,e){return n.includes(e)}s(V,"includesValue");function be(n){return V(pe,n)}s(be,"isAppVersionLifecycleState");function Re(n){return V(ce,n)}s(Re,"isAppVersionAlias");function De(n){return typeof n.version=="string"&&be(n.lifecycleState)&&typeof n.entrypoint=="string"&&typeof n.createdTime=="number"&&typeof n.createdBy=="string"&&typeof n.appExternalId=="string"&&(n.alias===void 0||Re(n.alias))&&(n.comment===void 0||typeof n.comment=="string")}s(De,"isAppVersion");function ae(n){if(!g(n)){let e=JSON.stringify(n)?.slice(0,200)??String(n);throw new Error(`Invalid version response: expected object, got ${e}`)}if(!De(n)){let e=JSON.stringify(n).slice(0,300);throw new Error(`Invalid version response: missing or malformed fields. Got: ${e}`)}return n}s(ae,"parseAppVersion");function $e(n){if(!g(n))throw new Error("Invalid app response: not an object");let{externalId:e,name:t,description:r}=n;if(typeof e!="string")throw new Error("Invalid app response: missing externalId");if(typeof t!="string")throw new Error("Invalid app response: missing name");if(r!=null&&typeof r!="string")throw new Error("Invalid app response: malformed description");return{externalId:e,name:t,description:typeof r=="string"?r:void 0}}s($e,"parseAppMetadata");var q=class q{constructor(e){this.client=e}get appsBasePath(){return`/api/v1/projects/${encodeURIComponent(this.client.project)}/apphosting/apps`}async createApp(e,t,r){try{await this.client.post(this.appsBasePath,{data:{items:[{externalId:e,name:t,description:r}]}})}catch(i){throw h(i)??i}}async updateApps(e){try{await this.client.post(`${this.appsBasePath}/update`,{data:{items:e}})}catch(t){throw h(t)??t}}async getApp(e){let t=`${this.appsBasePath}/${encodeURIComponent(e)}`;try{let r=await this.client.get(t);return $e(r.data)}catch(r){throw D(r,[e])?new U(e):h(r)??r}}async uploadVersion(e,t,r,i,o="index.html"){console.log(`\u{1F4E4} Uploading version ${t}...`);let a=new FormData;a.append("file",new Blob([new Uint8Array(r)]),i),a.append("version",t),a.append("entryPath",o);let p=encodeURIComponent(e),c=`${this.appsBasePath}/${p}/versions`,d=await this.client.authenticate();if(!d)throw new l("Failed to authenticate for upload",{hint:"Check your credentials and try again."});let S=w.from(d),f=`${this.client.getBaseUrl()}${c}`,Q=new AbortController,Se=setTimeout(()=>Q.abort(),300*1e3),E;try{E=await fetch(f,{method:"POST",headers:{Authorization:`Bearer ${S.expose()}`},body:a,signal:Q.signal})}catch(m){throw m instanceof Error&&m.name==="AbortError"?new l("Upload timed out after 5 minutes",{hint:"The upload took longer than 5 minutes. Try again \u2014 if it keeps timing out, check your network speed or bundle size."}):new l(`Failed to upload version to ${f}`,{cause:m,hint:"Check your network connection. Uploads can also fail behind a proxy that blocks multipart POST requests."})}finally{clearTimeout(Se)}if(!E.ok){let m=await E.text(),A;try{A=JSON.parse(m)}catch{}let b=m;if(g(A)){let k=A.error;if(typeof k=="string")b=k;else if(g(k)){let x=k.message,te=k.code;b=typeof x=="string"?x:te!=null?`Unknown error (code: ${te})`:m}else{let x=A.message;b=typeof x=="string"?x:m}}let ee=E.headers.get("x-request-id"),we=ee?` | X-Request-ID: ${ee}`:"",Ee=g(A)?A:m;throw new v(`Upload failed: ${E.status} \u2014 ${b}${we}`,{httpStatusCode:E.status,requestUrl:f,responseBody:Ee})}console.log(`\u2705 Version ${t} uploaded`)}async getVersion(e,t){let r=encodeURIComponent(e),i=encodeURIComponent(t),o=`${this.appsBasePath}/${r}/versions/${i}`;try{let a=await this.client.get(o);return ae(a.data)}catch(a){throw D(a,[e,t])?new $(e,t):h(a)??a}}async getActiveVersion(e){let t=encodeURIComponent(e),r=`${this.appsBasePath}/${t}/versions/list`;try{let i=await this.client.post(r,{data:{filter:{aliases:["ACTIVE"]}}});if(!g(i.data)||!Array.isArray(i.data.items))throw new Error("Invalid versions/list response: expected an object with an items array");let{items:o}=i.data;if(o.length===0)return null;if(o.length>1)throw new Error(`Unexpected response: ${o.length} versions have the ACTIVE alias, expected at most 1`);return ae(o[0])}catch(i){if(D(i,[e]))return null;throw h(i)??i}}async deleteVersions(e,t){let r=encodeURIComponent(e),i=`${this.appsBasePath}/${r}/versions/delete`;try{await this.client.post(i,{data:{items:t.map(o=>({version:o}))}})}catch(o){throw h(o)??o}}async updateVersions(e,t){let r=encodeURIComponent(e),i=`${this.appsBasePath}/${r}/versions/update`;try{await this.client.post(i,{data:{items:t}})}catch(o){throw h(o)??o}}async submitSignatures(e,t,r){let i=encodeURIComponent(e),o=encodeURIComponent(t),a=`${this.appsBasePath}/${i}/versions/${o}/signatures`;try{await this.client.post(a,{data:{items:r}})}catch(p){throw h(p)??p}}async listSignatures(e,t){let r=encodeURIComponent(e),i=encodeURIComponent(t),o=`${this.appsBasePath}/${r}/versions/${i}/signatures/list`;try{let a=await this.client.post(o,{data:{}});return Ne(a.data)}catch(a){throw h(a)??a}}};s(q,"AppHostingApi");var N=q,Ue=["VALID","REVOKED","EXPIRED","SIGNED_BEFORE_KEY_ISSUED","IAT_IN_FUTURE","BUNDLE_TOO_OLD","KEY_NOT_IN_REGISTRY"],Ve=["developer","certifier"];function Ne(n){if(!g(n))throw new Error("Invalid signatures response: expected an object with an items array");let{items:e}=n;if(!Array.isArray(e))throw new Error("Invalid signatures response: items property is missing or not an array");return e.flatMap(t=>{let r=Fe(t);return r?[r]:[]})}s(Ne,"parseStoredSignatures");function Fe(n){if(!g(n))return null;let{signerKid:e,signerRole:t,signatureIat:r,receivedAt:i,createdTime:o,status:a}=n;return typeof e!="string"||e===""||!V(Ve,t)||typeof r!="number"||typeof i!="number"||typeof o!="number"||!V(Ue,a)?null:{signerKid:e,signerRole:t,signatureIat:r,receivedAt:i,createdTime:o,status:a}}s(Fe,"parseStoredSignature");function Oe(n,e){let t=[];n.name!==e.name&&t.push({field:"name",remote:n.name,local:e.name});let r=n.description??"";return r!==e.description&&t.push({field:"description",remote:r,local:e.description}),t}s(Oe,"diffAppMetadata");function _e(n){let e=["Cannot deploy: metadata in app.json differs from what's deployed:"];for(let{field:t,remote:r,local:i}of n){let o=`${t}:`.padEnd(14);e.push(` ${o}"${r}" \u2192 "${i}"`)}return e.join(`
|
|
5
|
-
`)}s(_e,"formatMetadataDriftError");var J=class J{constructor(e){this.api=new N(e)}getVersion(e,t){return this.api.getVersion(e,t)}uploadVersion(e,t,r,i,o){return this.api.uploadVersion(e,t,r,i,o)}async ensureApp(e,t,r){console.log("\u{1F50D} Ensuring app exists...");try{await this.api.createApp(e,t,r),console.log(`\u2705 App '${e}' created`)}catch(i){if(P(i)&&i.status===409){console.log(`\u2705 App '${e}' already exists`),await this.checkMetadataDrift(e,t,r);return}throw i}}async checkMetadataDrift(e,t,r){let i;try{i=await this.getApp(e)}catch{return}let o=Oe(i,{name:t,description:r});if(o.length!==0)throw new l(_e(o),{hint:"Run npx @cognite/cli apps metadata update to sync before deploying",shouldReport:!1})}getApp(e){return this.api.getApp(e)}async updateAppMetadata(e,t,r){await this.api.updateApps([{externalId:e,update:{name:{set:t},description:r?{set:r}:{setNull:!0}}}])}async submitSignatures(e,t,r){r.length!==0&&(console.log(`\u{1F50F} Submitting ${r.length} signature${r.length===1?"":"s"} for version ${t}...`),await this.api.submitSignatures(e,t,r),console.log("\u2705 Signatures stored"))}listSignatures(e,t){return this.api.listSignatures(e,t)}async publishVersion(e,t){await this.api.updateVersions(e,[{version:t,update:{lifecycleState:{set:"PUBLISHED"}}}])}async publishAndActivate(e,t){console.log(`\u{1F680} Publishing and activating version ${t}...`),await this.api.updateVersions(e,[{version:t,update:{lifecycleState:{set:"PUBLISHED"},alias:{set:"ACTIVE"}}}]),console.log(`\u2705 Version ${t} is now PUBLISHED and ACTIVE`)}getActiveVersion(e){return this.api.getActiveVersion(e)}async deactivateVersion(e,t){await this.api.updateVersions(e,[{version:t,update:{alias:{setNull:!0}}}])}async deleteVersion(e,t){await this.api.deleteVersions(e,[t])}async deprecateVersion(e,t){await this.api.updateVersions(e,[{version:t,update:{lifecycleState:{set:"DEPRECATED"}}}])}async archiveVersion(e,t){await this.api.updateVersions(e,[{version:t,update:{lifecycleState:{set:"ARCHIVED"}}}])}async activateVersion(e,t){let r=null;try{r=await this.api.getActiveVersion(e)}catch{r=null}let i=r&&r.version!==t?r.version:void 0;return await this.api.updateVersions(e,[{version:t,update:{alias:{set:"ACTIVE"}}}]),{supersededVersion:i}}async deploy(e,t,r,i,o,a,p=!1){console.log(`
|
|
6
|
-
\u{1F680} Deploying application via App Hosting API...
|
|
7
|
-
`),await this.ensureApp(e,t,r),await this.uploadVersion(e,i,o,a),p&&await this.publishAndActivate(e,i),console.log(`
|
|
8
|
-
\u2705 Deployment successful!`)}};s(J,"AppHostingClient");var C=J;import{execFileSync as F}from"child_process";import y from"fs";import u from"path";import{parseAndValidateManifestConfig as Le}from"@cognite/app-sdk/vite";import{BlobReader as Me,Uint8ArrayWriter as je,ZipWriter as Ge}from"@zip.js/zip.js";import{execFileSync as Be}from"child_process";function He(n={}){let{execFileSync:e=Be}=n;try{return e("git",["--version"],{stdio:"ignore"}),!0}catch{return!1}}s(He,"isGitInstalled");function de(n={}){if(!He(n))throw new l("Git is not installed or not found on PATH.",{hint:"Install Git (https://git-scm.com) and ensure it is on your PATH, then try again.",shouldReport:!1})}s(de,"throwIfGitMissing");var z="package.json",Y="package-lock.json",le="manifest.json",K=".cognite",qe=[/^\.env(\..+)?$/i,/^\.secrets?$/i,/^\.token/i,/^\.cognite/i,/\.(key|pem|p12|pfx|jks|crt)$/i],W=class W{constructor(e="dist"){this.distPath=u.isAbsolute(e)?e:u.join(process.cwd(),e),this.appRoot=u.dirname(this.distPath)}validateBuildDirectory(){if(!y.existsSync(this.distPath))throw new Error(`Build directory "${this.distPath}" not found. Run build first.`);let e=u.join(this.appRoot,z);if(!y.existsSync(e))throw new Error(`"${e}" not found. It is required for deployment.`);let t=u.join(this.appRoot,Y);if(!y.existsSync(t))throw new Error(`"${t}" not found. It is required for deployment.`)}async createZip(e="app.zip",t=!1){this.validateBuildDirectory(),console.log("\u{1F4E6} Packaging application...");let r=new Ge(new je,{level:9}),i=s(async(c,d)=>{await r.add(d,new Me(await y.openAsBlob(c))),t&&console.log(` \u{1F4C4} ${d}`)},"addFile"),o=s(async c=>{let d=await y.promises.readdir(c,{withFileTypes:!0});for(let S of d){let f=u.join(c,S.name);S.isDirectory()?await o(f):await i(f,u.relative(this.distPath,f).replace(/\\/g,"/"))}},"addDir"),a;try{await o(this.distPath);let c=u.join(this.appRoot,z);await i(c,u.posix.join(K,z));let d=u.join(this.appRoot,le);if(y.existsSync(d)){let f=y.readFileSync(d,"utf-8");Le(f,d),await i(d,u.posix.join(K,le))}let S=u.join(this.appRoot,Y);await i(S,u.posix.join(K,Y)),a=await r.close()}catch(c){let d=c instanceof Error?c.message:String(c);throw new Error(`Failed to create zip: ${d}`)}try{await y.promises.writeFile(e,a)}catch(c){throw new l(`Failed to write bundle to ${e}`,{cause:c})}let p=(a.byteLength/1024/1024).toFixed(2);return console.log(`\u2705 App packaged: ${e} (${p} MB)`),e}async createSourceArchive(e){console.log("\u{1F4E6} Packaging source for review...");let t;try{t=F("git",["-C",this.appRoot,"rev-parse","--show-toplevel"],{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()}catch(c){throw de(),new l("Source packaging requires a git repository.",{hint:"Run `git init` first.",shouldReport:!1,cause:c})}let r=F("git",["-C",this.appRoot,"rev-parse","--show-prefix"],{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim(),i=r?r.replace(/\/$/,""):".",o=i==="."?"HEAD":`HEAD:${i}`;this.validateNoSensitiveFiles(t,o);try{F("git",["-C",t,"archive","--format=zip",`--output=${e}`,o])}catch(c){let d=c instanceof Error?c.message:String(c);throw new Error(`Failed to create source archive: ${d}`)}let p=(y.statSync(e).size/1024/1024).toFixed(2);return console.log(`\u2705 Source packaged: ${u.basename(e)} (${p} MB)`),e}validateNoSensitiveFiles(e,t){let r=F("git",["-C",e,"ls-tree","-r","--name-only",t],{encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim().split(`
|
|
9
|
-
`).filter(Boolean),i=s(a=>a.split("/").some(p=>qe.some(c=>c.test(p))),"isSensitive"),o=r.filter(i);if(o.length>0)throw new Error(`Source archive would include sensitive files \u2014 remove them from git tracking first:
|
|
10
|
-
`+o.map(a=>` ${a}`).join(`
|
|
11
|
-
`)+`
|
|
12
|
-
Hint: git rm --cached <file>`)}};s(W,"ApplicationPackager");var T=W;import Je from"path";var ue=".cognite-bundles";function ge(n,e){return`${n}-${e}.zip`}s(ge,"bundleFileName");function O(n,e,t){return Je.join(n,ue,ge(e,t))}s(O,"bundlePath");import{CogniteClient as nt}from"@cognite/sdk";function ze(n){return Math.floor(Math.random()*Math.min(2**n*250,15e3))}s(ze,"exponentialBackoffWithJitter");function Ye(n){return new Promise(e=>setTimeout(e,n))}s(Ye,"sleep");async function he(n,e={}){let t=e.maxAttempts??5,r=e.shouldRetry??(()=>!0),i=e.delayInMsCalculator??ze;if(t<1)throw new Error("`maxAttempts` must be 1 or greater");if(t>100)throw new Error("`maxAttempts` must be 100 or less");let o=1;for(;;)try{return await n()}catch(a){if(o>=t||!r(a))throw a;let p=i(o);e.onAttemptFail?.(a,o,p),await Ye(p),o++}}s(he,"retryAsync");var Ke="https://auth.cognite.com/oauth2/token",We=s(n=>typeof n=="object"&&n!==null&&"access_token"in n&&typeof n.access_token=="string","hasAccessToken");async function fe({idp:n,tokenUrl:e,init:t,missingTokenHint:r}){let i;try{i=await he(()=>fetch(e,t),{maxAttempts:3})}catch(p){throw new l(`Failed to fetch access token from ${e}`,{cause:p})}if(!i.ok){let p=await i.text();throw new v(`Failed to get token from ${n}: ${i.status} ${i.statusText}`,{httpStatusCode:i.status,requestUrl:e,responseBody:p})}let o=await i.text(),a;try{a=JSON.parse(o)}catch{throw new l(`Unexpected response from ${n} authentication (invalid JSON)`,{hint:r})}if(!We(a))throw new l(`No access token in ${n} authentication response`,{hint:r});return w.from(a.access_token)}s(fe,"fetchOAuthToken");var Xe=s(()=>{let n=process.env.DEPLOYMENT_SECRETS;if(!n)return{};try{let e=JSON.parse(n),t={};for(let[r,i]of Object.entries(e))if(typeof i=="string"){let o=r.toLowerCase().replace(/_/g,"-");t[o]=i}return t}catch(e){return console.error("Error parsing DEPLOYMENT_SECRETS:",e),{}}},"loadSecretsFromEnv"),Ze=s(n=>{let e;if(process.env.DEPLOYMENT_SECRET&&(e=process.env.DEPLOYMENT_SECRET),e||(e=Xe()[n]),e||(e=process.env[n]),!e)throw new Error(`Secret not found in environment: ${n}`);return w.from(e)},"getSecretFromEnv"),Qe=s((n,e)=>{let t=e.expose();return fe({idp:"CDF",tokenUrl:Ke,init:{method:"POST",headers:{Authorization:`Basic ${btoa(`${n}:${t}`)}`,"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"client_credentials"})},missingTokenHint:"Check the client ID in app.json and the deployment secret in your environment."})},"getTokenCdf"),me=s(({idp:n,tokenUrl:e,clientId:t,clientSecret:r,scopes:i,missingTokenHint:o})=>fe({idp:n,tokenUrl:e,init:{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:t,client_secret:r,grant_type:"client_credentials",...i!==void 0?{scope:i.join(" ")}:{}})},missingTokenHint:o}),"getTokenWithClientCredentials"),et=s((n,e)=>{if(e!==void 0)return e.join(" ");if(!n)throw new Error("Entra ID authentication requires 'baseUrl' to be set in deployment configuration");try{return`${new URL(n).origin}/.default`}catch{throw new Error(`Entra ID authentication requires 'baseUrl' to be a valid CDF URL (e.g., https://cluster.cognitedata.com), got: ${n}`)}},"resolveEntraScope"),tt=s((n,e,t,r,i)=>me({idp:"Entra ID",tokenUrl:`https://login.microsoftonline.com/${t}/oauth2/v2.0/token`,clientId:n,clientSecret:e.expose(),scopes:i!==void 0?i:[et(r)],missingTokenHint:"Check the client ID and tenant ID in app.json and the deployment secret in your environment."}),"getTokenEntra"),X=s(async(n,e=process.env)=>{if(e.COGNITE_TOKEN)return w.from(e.COGNITE_TOKEN);let{deployClientId:t,deploySecretName:r,idpType:i="cdf",tenantId:o,baseUrl:a,scopes:p,tokenUrl:c}=n,d=Ze(r);if(i==="oauth"){if(!c)throw new Error("OAuth authentication requires 'tokenUrl' in deployment configuration");return me({idp:"OAuth",tokenUrl:c,clientId:t,clientSecret:d.expose(),scopes:p,missingTokenHint:"Check the tokenUrl, client ID, scopes, and deployment secret in app.json and your environment."})}if(i==="entra_id"){if(!o)throw new Error("Entra ID authentication requires 'tenantId' in deployment configuration");return tt(t,d,o,a,p)}return Qe(t,d)},"getToken");async function _(n,e,t=process.env,r){let i=await X(n,t),o=t.COGNITE_BASE_URL??n.baseUrl,a=(r??(p=>new nt(p)))({appId:e,project:n.project,baseUrl:o,oidcTokenProvider:s(async()=>i.expose(),"oidcTokenProvider")});return await a.authenticate(),a}s(_,"getSdk");import{existsSync as rt,readFileSync as it}from"fs";var B=[".dev.sig",".cert.sig"];function st(n,e={}){let t=e.existsSync??rt,r=e.readFileSync??((o,a)=>it(o,a)),i=[];for(let o of B){let a=`${n}${o}`;if(!t(a))continue;let p=r(a,"utf8").trim();p.length>0&&i.push(p)}return i}s(st,"discoverSignatures");async function ye(n,e,{existsSync:t=ot,mkdir:r=at,createZip:i=s((o,a)=>new T(o).createZip(a,!0),"createZipFn")}={}){let{externalId:o,versionTag:a}=n,p=O(e,o,a);if(t(p)){let d=B.some(S=>t(`${p}${S}`))?"A signed bundle already exists here. Re-deploying will invalidate the signing process. Bump versionTag in app.json to deploy as a new version, or delete the bundle and its .sig files then re-sign after deploying.":"Bump versionTag in app.json to deploy as a new version, or delete the existing bundle from .cognite-bundles/ to redeploy the same version.";throw new l(`Bundle already exists: ${p}`,{hint:d,shouldReport:!1})}await r(dt(p),{recursive:!0}),await i(`${e}/dist`,p)}s(ye,"packageBundle");async function Z(n,e,t,r,{readFile:i=pt,upload:o=s(async(a,p)=>new C(n).deploy(e.externalId,e.name,e.description,e.versionTag,a,p,r),"uploadFn")}={}){let a=O(t,e.externalId,e.versionTag),p;try{p=await i(a)}catch(c){throw new l(`Failed to read bundle file: ${a}`,{cause:c})}await o(p,ct(a))}s(Z,"uploadBundle");var lt=s(async(n,e,t)=>{let r=await _(n,t);await ye(e,t),await Z(r,e,t,n.published)},"deploy"),ut=s(async(n,e,t)=>{let r=await _(n,t);await Z(r,e,t,n.published)},"deployBundle");export{C as a,T as b,ue as c,ge as d,O as e,X as f,_ as g,B as h,st as i,ye as j,Z as k,lt as l,ut as m};
|
package/dist/chunk-PZ2YS5FR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as c}from"./chunk-ATR2SGLU.js";function A(e){return{space:e.space,externalId:e.externalId,version:e.version}}c(A,"toSharedViewId");function Ee(e){switch(e){case"text":return"String";case"boolean":return"Boolean";case"int32":case"int64":return"Int";case"float32":case"float64":return"Float";case"timestamp":return"DateTime";case"date":return"Date";case"json":return"JSON";case"timeseries":return"CogniteTimeSeriesReference";case"file":return"CogniteFileReference";case"sequence":return"CogniteSequenceReference";case"enum":return"String";default:return"String"}}c(Ee,"dmsTypeToGraphQL");function ie(e){if(!("source"in e)){if(e.type?.type==="direct")return e.type.list?e.type.source?{kind:"directRelationList",targetView:A(e.type.source)}:{kind:"scalar",isList:!1,graphqlType:"JSON"}:e.type.source?{kind:"directRelation",targetView:A(e.type.source)}:{kind:"scalar",isList:!1,graphqlType:"JSON"};if(e.type?.type==="enum"){let t=e.type,n={};if(typeof t=="object"&&t!==null&&"values"in t){let i=t.values;if(typeof i=="object"&&i!==null)for(let[r,s]of Object.entries(i))n[r]={name:typeof s=="object"&&s!==null&&"name"in s?String(s.name):void 0}}return{kind:"enum",values:Object.keys(n),valueNames:Object.fromEntries(Object.entries(n).map(([i,r])=>[i,r.name??i]))}}return{kind:"scalar",isList:e.type!==void 0&&"list"in e.type&&e.type.list===!0,graphqlType:e.type?.type?Ee(e.type.type):"String"}}if("through"in e)return{kind:e.connectionType==="single_reverse_direct_relation"?"reverseDirect":"reverseList",sourceView:A(e.source),throughProperty:e.through.identifier};if(e.connectionType==="single_edge_connection"||e.connectionType==="multi_edge_connection"){let t=e.direction==="inwards"?"inwards":"outwards";return{kind:"edge",targetView:A(e.source),direction:t}}return{kind:"scalar"}}c(ie,"parsePropertyDescriptor");function oe(e,t,n){let i=e.property(t,n);return i?i.kind==="directRelation"?!1:i.kind==="directRelationList"?!0:i.kind==="scalar"&&i.graphqlType==="JSON":!0}c(oe,"isListThroughProperty");function x(e){return e.usedFor!=="edge"}c(x,"isNodeOrAll");function se(e){let t=new Set;return e.filter(n=>t.has(n.externalId)?!1:(t.add(n.externalId),!0))}c(se,"dedupeByExternalId");function ae(e){return Object.entries(e.properties).map(([t,n])=>[t,ie(n),n.description])}c(ae,"parsedProperties");async function ce(e,t){let i=(await t.dataModels.retrieve([{space:e.space,externalId:e.dataModelExternalId,version:e.dataModelVersion}],{inlineViews:!1})).items[0];if(!i)throw new Error(`Data model ${e.space}/${e.dataModelExternalId}/${e.dataModelVersion} not found`);if(!i.views?.length)throw new Error(`Data model ${e.space}/${e.dataModelExternalId}/${e.dataModelVersion} has no views`);let r=i.views.map(o=>({space:o.space,externalId:o.externalId,version:o.version}));return(await t.views.retrieve(r,{includeInheritedProperties:!0})).items}c(ce,"fetchViews");function le(e){let t=e.filter(x),n=new Map,i=new Map;for(let r of t){let s=new Map;for(let[a,p]of ae(r))s.set(a,p);let o={view:{space:r.space,externalId:r.externalId,version:r.version},properties:s};n.set(`${r.space}:${r.externalId}`,o),i.set(r.externalId,o)}return{view(r){let s=n.get(`${r.space}:${r.externalId}`)??i.get(r.externalId);if(!s)throw new Error(`SchemaKnowledge: no view for "${r.space}:${r.externalId}"`);return s},property(r,s){return(n.get(`${r.space}:${r.externalId}`)??i.get(r.externalId))?.properties.get(s)}}}c(le,"buildSchemaKnowledge");function pe(){return{initialBatchLimit:1e3,maxBatchLimit:5e3,searchLimit:1e3,inFilterChunkSize:100,reverseListChunkSize:1e3,previewLimit:3,nestedDetailLimit:5,enableRemoveNotConnected:!1,max408Retries:3,max429Retries:5,retryBaseDelayMs:500,maxConcurrentRequests:4,maxNestingDepth:2,maxTotalItems:1e4,maxFilterDepth:16}}c(pe,"defaultPlannerConfig");var K=class K extends Error{constructor(t){super(t),this.name="PlannerValidationError"}};c(K,"PlannerValidationError");var m=K;var Me={avg:c(e=>({avg:{property:e.property}}),"avg"),sum:c(e=>({sum:{property:e.property}}),"sum"),min:c(e=>({min:{property:e.property}}),"min"),max:c(e=>({max:{property:e.property}}),"max"),count:c(e=>({count:{property:e.property??"externalId"}}),"count"),histogram:c(e=>({histogram:{property:e.property,interval:e.interval}}),"histogram")};function ue(e){let t=Me[e.function];if(!t)throw new m(`Unknown aggregation function '${e.function}'`);if(e.function!=="count"&&!e.property)throw new m(`Property is required for '${e.function}' aggregation`);if(e.function==="histogram"&&e.interval===void 0)throw new m("Interval is required for 'histogram' aggregation");return t(e)}c(ue,"toAggregationDefinition");function de(e){return e.flatMap(t=>t.aggregates.map(n=>{if(n.aggregate==="histogram"){let{aggregate:o,property:a,buckets:p}=n;return{aggregate:o,property:a??null,value:null,buckets:p,group:t.group??null}}let{aggregate:i,property:r,value:s}=n;return{aggregate:i,property:r??null,value:s??null,buckets:null,group:t.group??null}}))}c(de,"flattenAggregateItems");function U(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}c(U,"isRecord");function P(e){return typeof e=="string"||typeof e=="number"}c(P,"isScalar");var _e={space:["node","space"],externalId:["node","externalId"]};function Fe(e,t){return _e[t]??[e.space,`${e.externalId}/${e.version}`,t]}c(Fe,"propRef");var Oe={exists:c((e,t)=>typeof t!="boolean"?void 0:t?{exists:{property:e}}:{not:{exists:{property:e}}},"exists"),eq:c((e,t)=>({equals:{property:e,value:t}}),"eq"),in:c((e,t)=>Array.isArray(t)?{in:{property:e,values:t}}:void 0,"in"),isNull:c((e,t)=>typeof t!="boolean"?void 0:t?{not:{exists:{property:e}}}:{exists:{property:e}},"isNull"),prefix:c((e,t)=>typeof t=="string"?{prefix:{property:e,value:t}}:void 0,"prefix"),gte:c((e,t)=>P(t)?{range:{property:e,gte:t}}:void 0,"gte"),gt:c((e,t)=>P(t)?{range:{property:e,gt:t}}:void 0,"gt"),lte:c((e,t)=>P(t)?{range:{property:e,lte:t}}:void 0,"lte"),lt:c((e,t)=>P(t)?{range:{property:e,lt:t}}:void 0,"lt"),containsAny:c((e,t)=>Array.isArray(t)?{containsAny:{property:e,values:t}}:void 0,"containsAny"),containsAll:c((e,t)=>Array.isArray(t)?{containsAll:{property:e,values:t}}:void 0,"containsAll"),overlaps:c((e,t)=>Array.isArray(t)?{containsAny:{property:e,values:t}}:void 0,"overlaps")};function qe(e,t,n,i,r,s){let o=Fe(n,e),a=Object.entries(t).flatMap(([p,l])=>{if(l==null)return[];if(p==="nested"&&i&&U(l)){let d=i.property(n,e);if(d?.kind==="directRelation"){let f={type:"view",...d.targetView},g=b(l,f,i,r+1,s);if(g)return[{nested:{scope:[n.space,`${n.externalId}/${n.version}`,e],filter:g}}]}return[]}let u=Oe[p]?.(o,l);return u?[u]:[]});if(a.length!==0)return a.length===1?a[0]:{and:a}}c(qe,"translatePropertyFilter");function $e(e){if(e.length!==0)return e.length===1?e[0]:{and:e}}c($e,"collapse");function fe(e,t,n,i=16){return b(e,t,n,0,i)}c(fe,"buildFilter");function b(e,t,n,i,r){if(i>r)throw new m(`Filter nesting depth ${i} exceeds maximum ${r}. Reduce _and/_or/_not/nested nesting.`);if(!U(e))return;let s=Object.entries(e).flatMap(([o,a])=>{if(a==null)return[];if(o==="_not"){let p=b(a,t,n,i+1,r);return p?[{not:p}]:[]}if(o==="hasData"&&typeof a=="boolean"&&a)return[{hasData:[{type:"view",space:t.space,externalId:t.externalId,version:t.version}]}];if(o==="matchAll"&&typeof a=="boolean"&&a)return[{matchAll:{}}];if((o==="_and"||o==="_or")&&Array.isArray(a)){let p=a.flatMap(l=>{let u=b(l,t,n,i+1,r);return u?[u]:[]});return p.length>0?[o==="_and"?{and:p}:{or:p}]:[]}if(U(a)){let p=qe(o,a,t,n,i,r);return p?[p]:[]}return[]});return $e(s)}c(b,"buildFilterImpl");function ge(e,t){if(!(!e||e.length===0))return e.map(n=>({property:{view:t,property:n.field},direction:n.direction??"ascending",nullsFirst:n.nullsFirst}))}c(ge,"parseSortArg");var Qe=new Set(["space","externalId"]);function j(e,t){let n;try{n=t.view(e).properties}catch{return[]}let i=[];for(let[r,s]of n)(s.kind==="scalar"||s.kind==="enum"||s.kind==="directRelationList")&&!Qe.has(r)&&i.push(r);return i}c(j,"scalarNames");function me(e){switch(e.kind){case"directRelation":case"directRelationList":case"edge":return e.targetView;case"reverseDirect":case"reverseList":return e.sourceView;default:return}}c(me,"connectionTargetView");function Be(e,t,n){if(t==="count"||t==="aggregate")return{scalars:[],connections:new Map};let i=t==="query"||t==="search",r=j(e,n),s=new Map;for(let[o,a]of n.view(e).properties)if(a.kind==="directRelation"||a.kind==="reverseDirect"){let p=j(a.kind==="directRelation"?a.targetView:a.sourceView,n),l=i?["name","description"].filter(u=>p.includes(u)):p;s.set(o,{select:{scalars:l,connections:new Map}})}else!i&&(a.kind==="reverseList"||a.kind==="edge")&&s.set(o,{select:{scalars:[],connections:new Map}});return{scalars:r,connections:s}}c(Be,"buildDefaultSelection");function ye(e,t,n){let i=t.select?[...t.select]:j(e,n),r=new Map;if(t.with)for(let[s,o]of Object.entries(t.with)){let a=n.property(e,s),p=a&&me(a);if(!p)throw new m(`Connection "${s}" does not exist on view ${e.externalId}`);r.set(s,{limit:o.limit,select:ye(p,o,n)})}return{scalars:i,connections:r}}c(ye,"buildWithTree");function C(e,t,n,i){let r=Be(e,t,i);if(!n||!n.select&&!n.with)return r;let s=n.select?[...n.select]:r.scalars,a=n.select&&t==="getById"?new Map:new Map(r.connections);if(n.with)for(let[p,l]of Object.entries(n.with)){let u=i.property(e,p),d=u&&me(u);if(!d)throw new m(`Connection "${p}" does not exist on view ${e.externalId}`);a.set(p,{limit:l.limit,select:ye(d,l,i)})}return{scalars:s,connections:a}}c(C,"toSelectionTree");function H(e,t,n){let i=new Map;for(let o of e.filter(x))i.set(o.externalId,{type:"view",space:o.space,externalId:o.externalId,version:o.version});function r(o){let a=i.get(o);if(!a)throw new m(`Unknown view "${o}"`);return a}c(r,"resolveView");let s=c((o,a)=>fe(a,o,t,n.maxFilterDepth),"filterFor");return{async query(o,a={}){let p=r(o);return await n.query({view:p,select:C(p,"query",a,t),filter:s(p,a.filter),sort:ge(a.sort,p),cursor:a.cursor,limit:a.limit})},async getById(o,a){let p=r(o),l={and:[{equals:{property:["node","space"],value:a.space}},{equals:{property:["node","externalId"],value:a.externalId}}]},{items:u}=await n.query({view:p,select:C(p,"getById",a,t),filter:l,limit:1});return u[0]??null},async count(o,a={}){let p=r(o);return n.count({view:p,filter:s(p,a.filter)})},async search(o,a={}){let p=r(o);return await n.search({view:p,query:a.query,limit:a.limit,filter:s(p,a.filter),sort:a.sort,select:C(p,"search",a,t),properties:a.properties})},async aggregate(o,a={}){let p=r(o),{items:l}=await n.aggregate({view:p,filter:s(p,a.filter),aggregates:(a.aggregates??[{function:"count"}]).map(ue),groupBy:a.groupBy,query:a.query});return de(l)}}}c(H,"createSdkDispatcher");import{CogniteError as je}from"@cognite/sdk";function Ke(e){let t=e.property.view;return{property:[t.space,`${t.externalId}/${t.version}`,e.property.property],direction:e.direction,nullsFirst:e.nullsFirst??!1}}c(Ke,"compileSortClause");function Ue(e,t){let n=new Set,i=new Map(e.map(r=>[r.name,r]));for(let r of e){if(r.queryable)continue;let s=r.from;if(!s||s in t)continue;let o=i.get(s);o?.view&&(t[s]={sources:[{source:o.view,properties:["*"]}]},n.add(s))}return n}c(Ue,"injectPhantomSelects");function z(e,t,n){let i={},r={};for(let l of e){if(!l.queryable)continue;if(l.kind==="edgeIntermediate"){let f={edges:{from:l.from,direction:l.direction,maxDistance:1},limit:Math.min(l.limit,n)};l.filter&&(f.edges.filter=l.filter),l.limitEach!=null&&(f.edges.limitEach=l.limitEach),i[l.name]=f,r[l.name]={sources:[]};continue}let u={filter:l.filter};l.from&&(u.from=l.from),l.chainTo?u.chainTo=l.chainTo:l.through?(u.through={view:l.through.view,identifier:l.through.property},u.direction=l.direction):l.direction&&(u.direction=l.direction);let d={limit:Math.min(l.limit,n),nodes:u};l.sort&&l.sort.length>0&&(d.sort=l.sort.map(Ke)),i[l.name]=d,r[l.name]={sources:[{source:l.view,properties:l.select}]}}let s=Ue(e,r),o={with:i,select:r},a={},p=!1;for(let l of e){if(!l.queryable||l.kind==="edgeIntermediate")continue;let u=t.get(l.name);u!=null&&(a[l.name]=u,p=!0)}return p&&(o.cursors=a),{query:o,tempSelectSteps:s}}c(z,"compileQuery");function G(e,t){let n=[];for(let i=0;i<e.length;i+=t)n.push(e.slice(i,i+t));return n}c(G,"chunkArray");function He(e){let t=e.through;return[t.view.space,`${t.view.externalId}/${t.view.version}`,t.property]}c(He,"throughPropertyPath");function ze(e,t){let n=e.filter,i={containsAny:{property:He(e),values:t}};return n?{and:[n,i]}:i}c(ze,"containsAnyParentFilter");var X=class X{constructor(t,n){this.dms=t;this.config=n}async run(t,n,i){let{response:r,tempSelectSteps:s,batchLimit:o}=await this.queryWithRetry(t,n,i),a={},p=new Map;for(let[l,u]of Object.entries(r.items))a[l]=u,p.set(l,r.nextCursor[l]??null);return await this.fetchReverseLists(t,a),{batch:a,nextCursors:p,tempSelectSteps:s,batchLimit:o}}async fetchConnections(t,n){await this.fetchReverseLists(t,n),await this.fetchQueryableConnections(t,n),await this.fetchEdgeConnections(t,n)}async queryWithRetry(t,n,i){let r=i,s=0;for(;;){let{query:o,tempSelectSteps:a}=z(t,n,r);try{return{response:await this.dms.query({with:o.with,select:o.select,cursors:o.cursors}),tempSelectSteps:a,batchLimit:r}}catch(p){if(p instanceof je&&p.status===408){if(s>=this.config.max408Retries)throw p;s++,r=Math.max(1,Math.floor(r/2))}else throw p}}}async fetchReverseLists(t,n){let i=t.filter(r=>!r.queryable&&r.from&&r.kind==="reverseList");for(let r of i){let s=n[r.from]??[];if(s.length===0){n[r.name]=[];continue}let o=s.map(l=>({space:l.space,externalId:l.externalId})),a=G(o,this.config.reverseListChunkSize),p=await Promise.all(a.map(async l=>{let u=[],d;do{let f={limit:r.limit,nodes:{filter:ze(r,l)}},g=await this.dms.query({with:{[r.name]:f},select:{[r.name]:{sources:[{source:r.view,properties:r.select}]}},...d?{cursors:{[r.name]:d}}:{}});u.push(...g.items[r.name]??[]),d=g.nextCursor?.[r.name]??void 0}while(d);return u}));n[r.name]=p.flat()}}async fetchQueryableConnections(t,n){let i=t.filter(r=>r.queryable&&r.from&&(r.kind==="directRelation"||r.kind==="reverseDirect"));for(let r of i){let s=n[r.from]??[];if(s.length===0){n[r.name]=[];continue}if(r.kind==="directRelation"){let o=r.through,a=`${o.view.externalId}/${o.view.version}`,p=[],l=new Set;for(let f of s){let g=f.properties?.[o.view.space]?.[a]?.[o.property];if(g&&typeof g=="object"&&"space"in g&&"externalId"in g&&typeof g.space=="string"&&typeof g.externalId=="string"){let y=`${g.space}:${g.externalId}`;l.has(y)||(l.add(y),p.push({space:g.space,externalId:g.externalId}))}}if(p.length===0){n[r.name]=[];continue}let u=G(p,this.config.inFilterChunkSize),d=await Promise.all(u.map(f=>this.dms.retrieve({items:f.map(g=>({instanceType:"node",...g})),sources:[{source:r.view}]})));n[r.name]=d.flatMap(f=>f.items)}else{let o=s.map(d=>({space:d.space,externalId:d.externalId})),a=r.through,p=[a.view.space,`${a.view.externalId}/${a.view.version}`,a.property],l=G(o,this.config.inFilterChunkSize),u=[];for(let d of l){let f=r.limit-u.length;if(f<=0)break;let g=await this.dms.search({view:r.view,filter:{in:{property:p,values:d}},limit:f});u.push(...g.items)}n[r.name]=u}}}async fetchEdgeConnections(t,n){let i=t.filter(r=>r.kind==="edgeIntermediate"&&r.from);for(let r of i){let s=n[r.from]??[],o=t.find(f=>f.kind==="edge"&&f.from===r.name);if(!o)continue;if(s.length===0){n[r.name]=[],n[o.name]=[];continue}let a=`${r.from}__edge_root`,p={nodes:{filter:{or:s.map(f=>({and:[{equals:{property:["node","space"],value:f.space}},{equals:{property:["node","externalId"],value:f.externalId}}]}))}},limit:s.length},l={edges:{from:a,direction:r.direction,maxDistance:1},limit:r.limit};r.filter&&(l.edges.filter=r.filter),r.limitEach!=null&&(l.edges.limitEach=r.limitEach);let u={nodes:{from:r.name,chainTo:o.chainTo},limit:o.limit};o.filter&&(u.nodes.filter=o.filter);let d=await this.dms.query({with:{[a]:p,[r.name]:l,[o.name]:u},select:{[a]:{sources:[]},[r.name]:{sources:[]},[o.name]:{sources:[{source:o.view,properties:o.select}]}}});n[r.name]=d.items[r.name]??[],n[o.name]=d.items[o.name]??[]}}};c(X,"QueryExecutor");var R=X;var Ge={endCursor:null,hasNextPage:!1};function Se(e){return{items:e,pageInfo:Ge}}c(Se,"wrapConnection");function V(e){if(!e||typeof e!="object"||!("space"in e)||!("externalId"in e))return!1;let{space:t,externalId:n}=e;return typeof t=="string"&&typeof n=="string"}c(V,"isDmsRef");function Xe(e,t){if(V(e))return e;if(typeof e!="object"||e===null||!("externalId"in e))return;let{externalId:n}=e;if(typeof n!="string")return;let i="space"in e&&typeof e.space=="string"?e.space:t;return i?{space:i,externalId:n}:void 0}c(Xe,"resolveParentRef");function We(e,t,n){if(V(e)){t(e);return}if(Array.isArray(e))for(let i of e){let r=Xe(i,n);r&&t(r)}}c(We,"forEachParentRef");var Ye=/^[a-z]{2,3}(-[a-zA-Z0-9]{2,4})?$/;function N(e){if(!e||typeof e!="object"||Array.isArray(e)||V(e))return e;let t=Object.entries(e);return t.length===0||!t.every(n=>typeof n[1]=="string"&&Ye.test(n[0]))?e:t.find(([n])=>n==="en")?.[1]??t[0][1]}c(N,"coerceTextWithLocale");function we(e,t){let n=`${t.externalId}/${t.version}`,i=e.properties?.[t.space]?.[n]??{},r={};for(let[s,o]of Object.entries(i))r[s]=N(o);return{...r,space:e.space,externalId:e.externalId}}c(we,"extractViewProperties");function L(e,t,n,i){if(t.length===0)return;let r=[...n.values()].filter(o=>o.from===e.name&&o.fieldName),s=[...n.values()].filter(o=>o.kind==="edge"&&o.fieldName&&o.from!=null&&n.get(o.from)?.from===e.name);for(let o of[...r,...s]){let a=(i[o.name]??[]).map(p=>we(p,o.view));if(o.kind==="directRelation"){let p=new Map;for(let l of a)p.set(`${l.space}:${l.externalId}`,l);for(let l of t){let u=l[o.fieldName];l[o.fieldName]=V(u)?p.get(`${u.space}:${u.externalId}`)??null:null}L(o,a,n,i)}else if(o.kind==="reverseDirect"||o.kind==="reverseList"){let p=o.through.property,l=new Map;for(let u of t)l.set(`${u.space}:${u.externalId}`,[]);for(let u of a){let d=u[p];d!=null?We(d,f=>{l.get(`${f.space}:${f.externalId}`)?.push(u)},u.space):t.length===1&&l.get(`${t[0].space}:${t[0].externalId}`)?.push(u)}for(let u of t){let d=l.get(`${u.space}:${u.externalId}`)??[];u[o.fieldName]=o.kind==="reverseList"?Se(d):d}L(o,a,n,i)}else if(o.kind==="edge"){let p=i[o.from]??[],l=new Map;for(let d of p){if(d.instanceType!=="edge")continue;let{startNode:f,endNode:g}=d;if(!f||!g)continue;let y=o.chainTo==="destination"?f:g,h=o.chainTo==="destination"?g:f,S=`${y.space}:${y.externalId}`,w=`${h.space}:${h.externalId}`,ne=l.get(S)??[];ne.push(w),l.set(S,ne)}let u=new Map;for(let d of a)u.set(`${d.space}:${d.externalId}`,d);for(let d of t){let f=`${d.space}:${d.externalId}`,y=(l.get(f)??[]).map(h=>u.get(h)).filter(h=>h!==void 0);d[o.fieldName]=Se(y)}L(o,a,n,i)}}}c(L,"nestChildrenForStep");function Je(e,t,n){let i=e.find(s=>!s.from);if(!i)return n;let r=new Map(e.map(s=>[s.name,s]));return L(i,n,r,t),n}c(Je,"nestChildren");function M(e,t){let n=e.find(r=>!r.from);if(!n)return[];let i=(t[n.name]??[]).map(r=>we(r,n.view));return Je(e,t,i)}c(M,"unpack");function W(e,t){for(let n of e)delete t[n]}c(W,"stripTempSelects");function Y(e){let t={};for(let[n,i]of e)i!=null&&(t[n]=i);return Object.keys(t).length===0?null:btoa(JSON.stringify(t))}c(Y,"encodeCursors");function Ze(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;for(let t of Object.values(e))if(typeof t!="string")return!1;return!0}c(Ze,"isStringRecord");function J(e){if(!e)return new Map;let t;try{t=JSON.parse(atob(e))}catch{throw new m("Invalid pagination cursor \u2014 the value is malformed or has been modified by the client.")}if(!Ze(t))throw new m("Invalid pagination cursor \u2014 expected a JSON object of {stepName: string}.");return new Map(Object.entries(t))}c(J,"decodeCursors");import{CogniteError as et}from"@cognite/sdk";function xe(){return{max429Retries:5,retryBaseDelayMs:500,maxConcurrentRequests:4}}c(xe,"defaultRetryConfig");function tt(e){return new Promise(t=>setTimeout(t,e))}c(tt,"sleep");var ee=class ee{constructor(t){this.queue=[];this.count=t}acquire(){return this.count>0?(this.count--,Promise.resolve()):new Promise(t=>this.queue.push(t))}release(){let t=this.queue.shift();t?t():this.count++}};c(ee,"Semaphore");var Z=ee,te=class te{constructor(t,n=xe()){this.inner=t;this.config=n;this.semaphore=new Z(n.maxConcurrentRequests)}query(t){return this.withRetry(()=>this.inner.query(t))}search(t){return this.withRetry(()=>this.inner.search(t))}aggregate(t){return this.withRetry(()=>this.inner.aggregate(t))}retrieve(t){return this.withRetry(()=>this.inner.retrieve(t))}sync(t){return this.withRetry(()=>this.inner.sync(t))}upsert(t){return this.inner.upsert(t)}delete(t){return this.inner.delete(t)}inspect(t){return this.inner.inspect(t)}async withRetry(t){let n=0;for(;;){await this.semaphore.acquire();let i=!1;try{return await t()}catch(r){if(r instanceof et&&r.status===429){if(n>=this.config.max429Retries)throw r;n++,this.semaphore.release(),i=!0,await tt(this.config.retryBaseDelayMs*2**(n-1))}else throw r}finally{i||this.semaphore.release()}}}};c(te,"RetryingDmsClient");var I=te;function F(e){return e.connections.size===0?0:1+Math.max(...[...e.connections.values()].map(t=>F(t.select)))}c(F,"selectionDepth");function rt(e,t,n){for(let i of t.scalars)if(i!=="*"&&!n.property(e,i))throw new m(`Property "${i}" does not exist on view ${e.externalId}/${e.version}`);for(let[i]of t.connections)if(!n.property(e,i))throw new m(`Connection "${i}" does not exist on view ${e.externalId}/${e.version}`)}c(rt,"validateSelection");function E(e){return{hasData:[e]}}c(E,"hasDataFilter");function nt(e,t){let n=E(t);return e?{and:[e,n]}:n}c(nt,"scopedFilter");function it(e,t,n,i,r){return{name:"0",kind:"root",view:e,filter:nt(t,e),sort:n&&n.length>0?n:void 0,select:i.length>0?i:["*"],limit:r,queryable:!0}}c(it,"makeRootStep");function ot(e,t,n,i,r,s){return{name:e,from:t.name,kind:"directRelation",view:i,through:{view:t.view,property:n},direction:"outwards",filter:E(i),select:r.length>0?r:["*"],limit:s,queryable:!0,fieldName:n}}c(ot,"makeDirectRelationStep");function st(e,t,n,i,r,s,o){return{name:e,from:t.name,kind:"reverseDirect",view:i,through:{view:i,property:r},direction:"inwards",filter:E(i),select:s.length>0?s:["*"],limit:o,queryable:!0,fieldName:n}}c(st,"makeReverseDirectStep");function at(e,t,n,i,r,s,o,a){return{name:e,from:t.name,kind:"reverseList",view:i,through:{view:i,property:r},direction:"inwards",filter:E(i),select:s.length>0?s:["*"],limit:o,queryable:!a,fieldName:n}}c(at,"makeReverseListStep");function ct(e,t,n,i,r,s,o,a){let p={name:e,from:n.name,kind:"edgeIntermediate",view:r,direction:s,filter:void 0,select:[],limit:a,limitEach:a,queryable:!0},l={name:t,from:e,kind:"edge",view:r,filter:E(r),select:o.length>0?o:["*"],limit:a,queryable:!0,fieldName:i,chainTo:s==="outwards"?"destination":"source"};return[p,l]}c(ct,"makeEdgeSteps");function _(e){return{type:"view",space:e.space,externalId:e.externalId,version:e.version}}c(_,"toRef");function Re(e,t){return e.length===0||e.includes("*")||e.includes(t)?e:[...e,t]}c(Re,"withThroughProperty");function lt(e,t){return e.includes("*")||e.includes(t)?e:[...e,t]}c(lt,"withDirectRelationRef");function k(e,t,n,i,r,s){let o=0;for(let[a,p]of n.connections){let l=r.property(t,a);if(!l)continue;o++;let u=p.limit??i,d=p.select.scalars,f=p.select,g=`${e.name}_${o}`;if(l.kind==="directRelation"){e.select=lt(e.select,a);let y=_(l.targetView),h=ot(g,e,a,y,d,u);s.push(h),k(h,y,f,i,r,s)}else if(l.kind==="reverseDirect"){let y=_(l.sourceView),h=Re(d,l.throughProperty),S=st(g,e,a,y,l.throughProperty,h,u);s.push(S),k(S,y,f,i,r,s)}else if(l.kind==="reverseList"){let y=_(l.sourceView),h=Re(d,l.throughProperty),S=oe(r,l.sourceView,l.throughProperty),w=at(g,e,a,y,l.throughProperty,h,u,S);s.push(w),k(w,y,f,i,r,s)}else if(l.kind==="edge"){let y=_(l.targetView),h=`${e.name}_${o}_e`,[S,w]=ct(h,g,e,a,y,l.direction,d,u);s.push(S,w),k(w,y,f,i,r,s)}}}c(k,"addConnectionSteps");function O(e,t,n,i,r,s,o){s&&rt(e,t,s);let a=it(e,n,i,t.scalars,r),p=[a];return s&&k(a,e,t,o??r,s,p),p}c(O,"buildSteps");var pt="5c4d853e7c3b77b1eb4468d5329b278c",ut="https://api.mixpanel.com/track",dt="flows-typed-ts-sdk";var D={ClientCreated:"Flows.SDK.ClientCreated",OperationExecuted:"Flows.SDK.OperationExecuted"};function ft(e){return typeof e=="object"&&e!==null}c(ft,"isRecord");function Ie(){let e=globalThis;return ft(e)?e:{}}c(Ie,"defaultEnv");function gt(e=Ie()){return e.COGNITE_TELEMETRY_DISABLED==="1"||e.DO_NOT_TRACK==="1"}c(gt,"isSdkTelemetryDisabled");function mt(e){return{track(t,n,i){let r=JSON.stringify([{event:t,properties:{token:e,...n}}]),s=new URLSearchParams({data:r});fetch(ut,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s.toString(),keepalive:!0}).then(()=>i(),()=>i())}}}c(mt,"fetchInit");var yt={track:c(()=>{},"track"),flush:c(async()=>{},"flush"),register:c(()=>{},"register")};function ht(e={}){let t=e.env??Ie();if(gt(t))return yt;let n=e.init??mt,i,r=new Set,s={};function o(){return i||(i=n(pt)),i}return c(o,"getClient"),{register(a){s={...s,...a}},track(a,p){let l=o(),u={...s,...p,applicationId:dt},d=c(()=>{},"finish"),f=new Promise(g=>{d=g});r.add(f);try{l.track(a,u,d)}catch{d()}f.finally(()=>r.delete(f))},async flush(a=2e3){if(r.size===0)return;let p,l=new Promise(u=>{p=setTimeout(u,a),p.unref?.()});try{await Promise.race([Promise.allSettled([...r]),l])}finally{p!==void 0&&clearTimeout(p)}}}}c(ht,"createSdkTelemetry");var T=ht();var re=class re{get schemaKnowledge(){return this.schema}get maxFilterDepth(){return this.config.maxFilterDepth}constructor(t,n,i,r=T){this.schema=n,this.config={...pe(),...i},this.telemetry=r,this.dms=new I(t,{max429Retries:this.config.max429Retries,retryBaseDelayMs:this.config.retryBaseDelayMs,maxConcurrentRequests:this.config.maxConcurrentRequests}),this.executor=new R(this.dms,{max408Retries:this.config.max408Retries,inFilterChunkSize:this.config.inFilterChunkSize,reverseListChunkSize:this.config.reverseListChunkSize})}async trackOperation(t,n,i){let r=performance.now();try{let s=await i();return this.telemetry.track(D.OperationExecuted,{operationType:t,viewExternalId:n.externalId,success:!0,durationMs:Math.round(performance.now()-r)}),s}catch(s){throw this.telemetry.track(D.OperationExecuted,{operationType:t,viewExternalId:n.externalId,success:!1,durationMs:Math.round(performance.now()-r)}),s}}async _queryPage(t){let n=F(t.select);if(n>this.config.maxNestingDepth)throw new m(`Query nesting depth ${n} exceeds the maximum of ${this.config.maxNestingDepth} enforced by the Data Modeling service. Reduce connection depth.`);let i=t.limit??this.config.initialBatchLimit,r=O(t.view,t.select,t.filter,t.sort,i,this.schema,this.config.previewLimit);if(r.length===0)return{items:[],pageInfo:{endCursor:null,hasNextPage:!1}};let s=new Map(J(t.cursor)),o=Math.min(this.config.initialBatchLimit,this.config.maxBatchLimit),{batch:a,nextCursors:p,tempSelectSteps:l}=await this.executor.run(r,s,o);W(l,a);let u=M(r,a),d=r[0],f=p.get(d.name)??null,g=Y(p),y=f!=null;return{items:u,pageInfo:{endCursor:g,hasNextPage:y}}}async query(t){return this.trackOperation("query",t.view,()=>this._queryPage(t))}async queryAll(t,n){let i=n??this.config.maxTotalItems,r=[],s,o=!0;for(;o;){let a=await this._queryPage({...t,cursor:s});if(r.push(...a.items),o=a.pageInfo.hasNextPage,s=a.pageInfo.endCursor??void 0,r.length>=i){if(n===void 0&&o)throw new m(`listAll reached the hard ceiling of ${i} items. Pass an explicit maxTotal to acknowledge this or raise maxTotalItems in config.`);break}}return r}async search(t){return this.trackOperation("search",t.view,async()=>{let n=t.limit??this.config.searchLimit,i=await this.dms.search({view:t.view,query:t.query,filter:t.filter,sort:t.sort,limit:n,properties:t.properties?[...t.properties]:void 0}),r=O(t.view,t.select,void 0,void 0,n,this.schema,this.config.previewLimit),s={0:i.items};return await this.executor.fetchConnections(r,s),{items:M(r,s),pageInfo:{endCursor:null,hasNextPage:!1}}})}async retrieve(t,n){return this.trackOperation("retrieve",n,async()=>{if(t.length===0)return[];let i=await this.dms.retrieve({items:t.map(s=>({instanceType:"node",space:s.space,externalId:s.externalId})),sources:[{source:n}]}),r=`${n.externalId}/${n.version}`;return i.items.map(s=>{let o=s.properties?.[n.space]?.[r]??{},a={};for(let[p,l]of Object.entries(o))a[p]=N(l);return{...a,space:s.space,externalId:s.externalId}})})}async count(t){return this.trackOperation("count",t.view,async()=>{let i=(await this.dms.aggregate({view:t.view,filter:t.filter,aggregates:[{count:{property:"externalId"}}]})).items[0]?.aggregates[0];return(i?.aggregate!=="histogram"?i?.value:void 0)??0})}async aggregate(t){return this.trackOperation("aggregate",t.view,async()=>({items:(await this.dms.aggregate({view:t.view,filter:t.filter,aggregates:t.aggregates,groupBy:t.groupBy,query:t.query})).items}))}async*queryPages(t){let n,i=!0;for(;i;){let r=await this._queryPage({...t,cursor:n});yield r,i=r.pageInfo.hasNextPage,n=r.pageInfo.endCursor??void 0}}};c(re,"QueryRunner");var v=re;async function St(e,t,n=T){let i=await ce(e,t);return ke(i,t,n)}c(St,"createSdkRuntime");function ke(e,t,n=T){let i=se(e),r=le(i),s=new v(t.instances,r,void 0,n),o=H(i,r,s);return n.register({project:t.project}),n.track(D.ClientCreated,{viewCount:i.filter(x).length}),{runner:s,dispatcher:o}}c(ke,"createSdkRuntimeFromViews");export{H as a,St as b,ke as c};
|
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
import { ViewDefinition as ViewDefinition$1, ViewPropertyDefinition, EnumProperty, ConnectionDefinitionRead, AggregatedHistogramValue, ViewReference, FilterDefinition, SearchSort, AggregationDefinition, AggregatedResultItem, InstancesAPI, CogniteClient } from '@cognite/sdk';
|
|
2
|
-
|
|
3
|
-
interface GenerateSdkConfig {
|
|
4
|
-
name: string;
|
|
5
|
-
space: string;
|
|
6
|
-
dataModelExternalId: string;
|
|
7
|
-
dataModelVersion: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface SharedViewId {
|
|
11
|
-
space: string;
|
|
12
|
-
externalId: string;
|
|
13
|
-
version: string;
|
|
14
|
-
}
|
|
15
|
-
type PropertyDescriptor = {
|
|
16
|
-
kind: 'scalar';
|
|
17
|
-
isList?: boolean;
|
|
18
|
-
graphqlType?: string;
|
|
19
|
-
} | {
|
|
20
|
-
kind: 'enum';
|
|
21
|
-
values: string[];
|
|
22
|
-
valueNames: Record<string, string>;
|
|
23
|
-
} | {
|
|
24
|
-
kind: 'directRelation';
|
|
25
|
-
targetView: SharedViewId;
|
|
26
|
-
} | {
|
|
27
|
-
kind: 'directRelationList';
|
|
28
|
-
targetView: SharedViewId;
|
|
29
|
-
} | {
|
|
30
|
-
kind: 'reverseDirect';
|
|
31
|
-
sourceView: SharedViewId;
|
|
32
|
-
throughProperty: string;
|
|
33
|
-
} | {
|
|
34
|
-
kind: 'reverseList';
|
|
35
|
-
sourceView: SharedViewId;
|
|
36
|
-
throughProperty: string;
|
|
37
|
-
} | {
|
|
38
|
-
kind: 'edge';
|
|
39
|
-
targetView: SharedViewId;
|
|
40
|
-
direction: 'outwards' | 'inwards';
|
|
41
|
-
};
|
|
42
|
-
interface SchemaView {
|
|
43
|
-
view: SharedViewId;
|
|
44
|
-
properties: Map<string, PropertyDescriptor>;
|
|
45
|
-
}
|
|
46
|
-
interface SchemaKnowledge {
|
|
47
|
-
view(ref: SharedViewId): SchemaView;
|
|
48
|
-
property(ref: SharedViewId, prop: string): PropertyDescriptor | undefined;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
type DmsEnumPropertyType = EnumProperty & {
|
|
52
|
-
list?: boolean;
|
|
53
|
-
maxListSize?: number;
|
|
54
|
-
};
|
|
55
|
-
type CodegenPropertyType = Exclude<ViewPropertyDefinition['type'], EnumProperty> | DmsEnumPropertyType;
|
|
56
|
-
type ViewDefinitionProperty = ((Omit<ViewPropertyDefinition, 'type'> & {
|
|
57
|
-
type: CodegenPropertyType;
|
|
58
|
-
}) | ConnectionDefinitionRead) & {
|
|
59
|
-
constraintState?: Record<string, unknown>;
|
|
60
|
-
description?: string;
|
|
61
|
-
};
|
|
62
|
-
type ViewDefinition = Omit<ViewDefinition$1, 'properties'> & {
|
|
63
|
-
properties: Record<string, ViewDefinitionProperty>;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
interface AggregateRequest {
|
|
67
|
-
function: string;
|
|
68
|
-
property?: string;
|
|
69
|
-
interval?: number;
|
|
70
|
-
}
|
|
71
|
-
interface AggregateRow {
|
|
72
|
-
aggregate: string;
|
|
73
|
-
property: string | null;
|
|
74
|
-
value: number | null;
|
|
75
|
-
buckets: AggregatedHistogramValue['buckets'] | null;
|
|
76
|
-
group: Record<string, unknown> | null;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
interface PropertyRef {
|
|
80
|
-
view: ViewReference;
|
|
81
|
-
property: string;
|
|
82
|
-
}
|
|
83
|
-
interface ConnectionSelection {
|
|
84
|
-
limit?: number;
|
|
85
|
-
select: SelectionTree;
|
|
86
|
-
}
|
|
87
|
-
interface SelectionTree {
|
|
88
|
-
scalars: string[];
|
|
89
|
-
connections: Map<string, ConnectionSelection>;
|
|
90
|
-
}
|
|
91
|
-
interface SortClause {
|
|
92
|
-
property: PropertyRef;
|
|
93
|
-
direction: 'ascending' | 'descending';
|
|
94
|
-
/** When true, nulls sort before non-nulls. Defaults to false. */
|
|
95
|
-
nullsFirst?: boolean;
|
|
96
|
-
}
|
|
97
|
-
/** Pre-translated DMS logical filter (output of translateFilter in resolver layer). */
|
|
98
|
-
type LogicalFilter = FilterDefinition;
|
|
99
|
-
interface QueryInput {
|
|
100
|
-
view: ViewReference;
|
|
101
|
-
filter?: LogicalFilter;
|
|
102
|
-
sort?: SortClause[];
|
|
103
|
-
select: SelectionTree;
|
|
104
|
-
/** Page size. Defaults to INITIAL_BATCH_LIMIT if omitted. */
|
|
105
|
-
limit?: number;
|
|
106
|
-
/** Opaque cursor from a previous ListResult.pageInfo.endCursor. */
|
|
107
|
-
cursor?: string;
|
|
108
|
-
}
|
|
109
|
-
interface ListResult<T = Record<string, unknown>> {
|
|
110
|
-
items: T[];
|
|
111
|
-
pageInfo: {
|
|
112
|
-
endCursor: string | null;
|
|
113
|
-
hasNextPage: boolean;
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
interface SearchInput {
|
|
118
|
-
view: ViewReference;
|
|
119
|
-
/** Full-text search term. */
|
|
120
|
-
query?: string;
|
|
121
|
-
filter?: LogicalFilter;
|
|
122
|
-
sort?: SearchSort[];
|
|
123
|
-
select: SelectionTree;
|
|
124
|
-
/** Max items to return. Defaults to searchLimit config. */
|
|
125
|
-
limit?: number;
|
|
126
|
-
/** Restrict search to specific property names within the view. */
|
|
127
|
-
properties?: readonly string[];
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
interface AggregateInput {
|
|
131
|
-
view: ViewReference;
|
|
132
|
-
filter?: LogicalFilter;
|
|
133
|
-
aggregates: AggregationDefinition[];
|
|
134
|
-
groupBy?: string[];
|
|
135
|
-
/** Optional full-text query to scope which instances are aggregated. */
|
|
136
|
-
query?: string;
|
|
137
|
-
}
|
|
138
|
-
interface AggregateOutput {
|
|
139
|
-
items: AggregatedResultItem[];
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
interface SortInput {
|
|
143
|
-
field: string;
|
|
144
|
-
direction?: 'ascending' | 'descending';
|
|
145
|
-
nullsFirst?: boolean;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
type DmsClient = Pick<InstancesAPI, 'query' | 'search' | 'aggregate' | 'retrieve' | 'upsert' | 'delete' | 'sync' | 'inspect'>;
|
|
149
|
-
interface PlannerConfig {
|
|
150
|
-
initialBatchLimit: number;
|
|
151
|
-
maxBatchLimit: number;
|
|
152
|
-
searchLimit: number;
|
|
153
|
-
inFilterChunkSize: number;
|
|
154
|
-
reverseListChunkSize: number;
|
|
155
|
-
previewLimit: number;
|
|
156
|
-
nestedDetailLimit: number;
|
|
157
|
-
enableRemoveNotConnected: boolean;
|
|
158
|
-
max408Retries: number;
|
|
159
|
-
max429Retries: number;
|
|
160
|
-
retryBaseDelayMs: number;
|
|
161
|
-
maxConcurrentRequests: number;
|
|
162
|
-
/** Maximum SelectionTree nesting depth. Throws PlannerValidationError if exceeded. */
|
|
163
|
-
maxNestingDepth: number;
|
|
164
|
-
/** Hard ceiling for listAll without an explicit maxTotal. Throws rather than silently truncating. */
|
|
165
|
-
maxTotalItems: number;
|
|
166
|
-
/** Maximum filter-tree recursion depth (_and/_or/_not/nested). Throws PlannerValidationError if exceeded. */
|
|
167
|
-
maxFilterDepth: number;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
type UnpackedNode = {
|
|
171
|
-
space: string;
|
|
172
|
-
externalId: string;
|
|
173
|
-
} & Record<string, unknown>;
|
|
174
|
-
|
|
175
|
-
/** Properties registered once at client init and merged into every subsequent event. */
|
|
176
|
-
interface SdkTelemetryBaseProperties {
|
|
177
|
-
project?: string;
|
|
178
|
-
}
|
|
179
|
-
/** Typed map of every event name to its specific properties. */
|
|
180
|
-
interface SdkTelemetryEventMap {
|
|
181
|
-
'Flows.SDK.ClientCreated': {
|
|
182
|
-
viewCount: number;
|
|
183
|
-
};
|
|
184
|
-
'Flows.SDK.OperationExecuted': {
|
|
185
|
-
operationType: 'query' | 'search' | 'count' | 'aggregate' | 'retrieve';
|
|
186
|
-
viewExternalId: string;
|
|
187
|
-
success: boolean;
|
|
188
|
-
durationMs: number;
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
type SdkTelemetryEventName = keyof SdkTelemetryEventMap;
|
|
192
|
-
interface SdkTelemetry {
|
|
193
|
-
track<E extends SdkTelemetryEventName>(eventName: E, properties: SdkTelemetryEventMap[E]): void;
|
|
194
|
-
flush(timeoutMs?: number): Promise<void>;
|
|
195
|
-
/** Merge properties into every subsequent event (Mixpanel-style super properties). */
|
|
196
|
-
register(baseProperties: SdkTelemetryBaseProperties): void;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
declare class QueryRunner {
|
|
200
|
-
private readonly dms;
|
|
201
|
-
private readonly schema;
|
|
202
|
-
private readonly config;
|
|
203
|
-
private readonly executor;
|
|
204
|
-
private readonly telemetry;
|
|
205
|
-
get schemaKnowledge(): SchemaKnowledge | undefined;
|
|
206
|
-
get maxFilterDepth(): number;
|
|
207
|
-
constructor(dms: DmsClient, schema?: SchemaKnowledge, config?: Partial<PlannerConfig>, telemetry?: SdkTelemetry);
|
|
208
|
-
private trackOperation;
|
|
209
|
-
private _queryPage;
|
|
210
|
-
query(input: QueryInput): Promise<ListResult<UnpackedNode>>;
|
|
211
|
-
/**
|
|
212
|
-
* Collects all pages until exhaustion. `input.limit` is the page size.
|
|
213
|
-
* `maxTotal` sets an explicit ceiling — without it, throws at `config.maxTotalItems`
|
|
214
|
-
* to prevent unbounded fetches.
|
|
215
|
-
*/
|
|
216
|
-
queryAll(input: Omit<QueryInput, 'cursor'>, maxTotal?: number): Promise<UnpackedNode[]>;
|
|
217
|
-
/**
|
|
218
|
-
* Full-text or filter-based search returning a single (non-paginated) result set.
|
|
219
|
-
* Use for top-level discovery; DMS search has eventual consistency — do not use
|
|
220
|
-
* for writes-then-reads or where strong consistency is required.
|
|
221
|
-
*/
|
|
222
|
-
search(input: SearchInput): Promise<ListResult<UnpackedNode>>;
|
|
223
|
-
/**
|
|
224
|
-
* Fetches specific nodes by space+externalId. Returns an empty array when ids is empty.
|
|
225
|
-
* Extracts view-scoped properties before returning, matching the shape of list results.
|
|
226
|
-
*/
|
|
227
|
-
retrieve(ids: Array<{
|
|
228
|
-
space: string;
|
|
229
|
-
externalId: string;
|
|
230
|
-
}>, view: ViewReference): Promise<UnpackedNode[]>;
|
|
231
|
-
/**
|
|
232
|
-
* Returns the total count of instances matching the filter.
|
|
233
|
-
* Wraps the filter with hasData so only instances with data in the view are counted.
|
|
234
|
-
*/
|
|
235
|
-
count(input: {
|
|
236
|
-
view: ViewReference;
|
|
237
|
-
filter?: LogicalFilter;
|
|
238
|
-
}): Promise<number>;
|
|
239
|
-
aggregate(input: AggregateInput): Promise<AggregateOutput>;
|
|
240
|
-
/**
|
|
241
|
-
* Async generator — yields one ListResult per page.
|
|
242
|
-
* Lets callers stream results or stop early without fetching remaining pages.
|
|
243
|
-
*/
|
|
244
|
-
queryPages(input: Omit<QueryInput, 'cursor'>): AsyncGenerator<ListResult<UnpackedNode>>;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
type OpKind = 'query' | 'getById' | 'count' | 'search' | 'aggregate';
|
|
248
|
-
/** Per-connection override passed via a method's `with` argument. */
|
|
249
|
-
interface WithSelection {
|
|
250
|
-
select?: readonly string[];
|
|
251
|
-
limit?: number;
|
|
252
|
-
with?: Record<string, WithSelection>;
|
|
253
|
-
}
|
|
254
|
-
interface SelectArgs {
|
|
255
|
-
/** Root scalar property names to return. Replaces the default scalar set. */
|
|
256
|
-
select?: readonly string[];
|
|
257
|
-
/** Nested connections to traverse, keyed by connection property name. */
|
|
258
|
-
with?: Record<string, WithSelection>;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Type helpers for the generated SDK's overloaded read methods. `select` is reflected in the
|
|
263
|
-
* return type soundly as `Partial<view>` (all fields optional) — exact per-key narrowing would
|
|
264
|
-
* require generic conditional types, which break cast-free mocking. These are plain type
|
|
265
|
-
* aliases used in the generated overload signatures; the methods themselves are not generic.
|
|
266
|
-
*/
|
|
267
|
-
type WithArg = Record<string, WithSelection>;
|
|
268
|
-
type ListItemOf<R> = R extends {
|
|
269
|
-
items: Array<infer I>;
|
|
270
|
-
} ? I : never;
|
|
271
|
-
type PageInfoOf<R> = R extends {
|
|
272
|
-
pageInfo: infer P;
|
|
273
|
-
} ? P : never;
|
|
274
|
-
type ArrayElementOf<R> = R extends Array<infer E> ? E : never;
|
|
275
|
-
type NodeIdentityKey = 'space' | 'externalId' | 'instanceType';
|
|
276
|
-
type NodeIdentity = {
|
|
277
|
-
space: string;
|
|
278
|
-
externalId: string;
|
|
279
|
-
};
|
|
280
|
-
type SelectArg<Q, K extends keyof Q> = readonly Exclude<keyof ListItemOf<Q[K]>, NodeIdentityKey>[];
|
|
281
|
-
type DetailSelectArg<Q, K extends keyof Q> = readonly Exclude<keyof NonNullable<Q[K]>, NodeIdentityKey>[];
|
|
282
|
-
type PartialListResult<Q, K extends keyof Q> = {
|
|
283
|
-
items: Array<NodeIdentity & Partial<Omit<ListItemOf<Q[K]>, keyof NodeIdentity>>>;
|
|
284
|
-
pageInfo: PageInfoOf<Q[K]>;
|
|
285
|
-
};
|
|
286
|
-
type PartialDetailResult<Q, K extends keyof Q> = (NodeIdentity & Partial<Omit<NonNullable<Q[K]>, keyof NodeIdentity>>) | null;
|
|
287
|
-
|
|
288
|
-
interface QueryArgs extends SelectArgs {
|
|
289
|
-
filter?: Record<string, unknown>;
|
|
290
|
-
sort?: SortInput[];
|
|
291
|
-
cursor?: string;
|
|
292
|
-
limit?: number;
|
|
293
|
-
}
|
|
294
|
-
interface GetByIdArgs extends SelectArgs {
|
|
295
|
-
space: string;
|
|
296
|
-
externalId: string;
|
|
297
|
-
}
|
|
298
|
-
interface CountArgs {
|
|
299
|
-
filter?: Record<string, unknown>;
|
|
300
|
-
}
|
|
301
|
-
interface SearchArgs extends SelectArgs {
|
|
302
|
-
query?: string;
|
|
303
|
-
filter?: Record<string, unknown>;
|
|
304
|
-
sort?: SearchSort[];
|
|
305
|
-
limit?: number;
|
|
306
|
-
properties?: readonly string[];
|
|
307
|
-
}
|
|
308
|
-
interface AggregateArgs {
|
|
309
|
-
filter?: Record<string, unknown>;
|
|
310
|
-
aggregates?: AggregateRequest[];
|
|
311
|
-
groupBy?: string[];
|
|
312
|
-
query?: string;
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Generated read-method types. Returns are flat (unwrapped from the keyed `*Query`): the method
|
|
316
|
-
* resolves to the operation's value `Q[K]`. Overloaded: without `select` → the full result; with
|
|
317
|
-
* `select` → `Partial` of the items/instance. Q is the generated `*Query` type, K its operation
|
|
318
|
-
* key, A the dispatcher arg shape, F the per-view filter.
|
|
319
|
-
*/
|
|
320
|
-
type ListMethod<Q, K extends keyof Q, A, F> = {
|
|
321
|
-
(args?: Omit<A, 'filter' | 'select'> & {
|
|
322
|
-
filter?: F;
|
|
323
|
-
}): Promise<Q[K]>;
|
|
324
|
-
(args: Omit<A, 'filter' | 'select'> & {
|
|
325
|
-
filter?: F;
|
|
326
|
-
select: SelectArg<Q, K>;
|
|
327
|
-
}): Promise<PartialListResult<Q, K>>;
|
|
328
|
-
};
|
|
329
|
-
type GetByIdMethod<Q, K extends keyof Q> = {
|
|
330
|
-
(args: Omit<GetByIdArgs, 'select'>): Promise<Q[K]>;
|
|
331
|
-
(args: Omit<GetByIdArgs, 'select'> & {
|
|
332
|
-
select: DetailSelectArg<Q, K>;
|
|
333
|
-
}): Promise<PartialDetailResult<Q, K>>;
|
|
334
|
-
};
|
|
335
|
-
type CountMethod<Q, K extends keyof Q, F> = (args?: {
|
|
336
|
-
filter?: F;
|
|
337
|
-
}) => Promise<Q[K]>;
|
|
338
|
-
type AggregateMethod<Q, K extends keyof Q, F> = (args?: Omit<AggregateArgs, 'filter'> & {
|
|
339
|
-
filter?: F;
|
|
340
|
-
}) => Promise<Q[K]>;
|
|
341
|
-
/**
|
|
342
|
-
* The seam the generated SDK calls. Translates typed object args into QueryRunner calls —
|
|
343
|
-
* no GraphQL document, no graphql-js. Each method computes its SelectionTree from
|
|
344
|
-
* SchemaKnowledge (default field policy) plus the caller's select/with.
|
|
345
|
-
*/
|
|
346
|
-
interface SdkDispatcher {
|
|
347
|
-
query<T = Record<string, unknown>>(view: string, args?: QueryArgs): Promise<ListResult<T>>;
|
|
348
|
-
getById<T = Record<string, unknown>>(view: string, args: GetByIdArgs): Promise<T | null>;
|
|
349
|
-
count(view: string, args?: CountArgs): Promise<number>;
|
|
350
|
-
search<T = Record<string, unknown>>(view: string, args?: SearchArgs): Promise<ListResult<T>>;
|
|
351
|
-
aggregate<R = AggregateRow>(view: string, args?: AggregateArgs): Promise<R[]>;
|
|
352
|
-
}
|
|
353
|
-
declare function createSdkDispatcher(views: ViewDefinition[], schemaKnowledge: SchemaKnowledge, runner: QueryRunner): SdkDispatcher;
|
|
354
|
-
|
|
355
|
-
interface SdkRuntime {
|
|
356
|
-
runner: QueryRunner;
|
|
357
|
-
/** Backs the generated SDK methods — translates typed args to DMS calls, no graphql-js. */
|
|
358
|
-
dispatcher: SdkDispatcher;
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* Builds the full runtime from a data model config. Fetches views from CDF, derives the
|
|
362
|
-
* schema knowledge, and returns a ready dispatcher.
|
|
363
|
-
*/
|
|
364
|
-
declare function createSdkRuntime(config: GenerateSdkConfig, client: CogniteClient, telemetry?: SdkTelemetry): Promise<SdkRuntime>;
|
|
365
|
-
/**
|
|
366
|
-
* Builds the runtime directly from an array of ViewDefinition objects — skips the
|
|
367
|
-
* data model lookup. Useful when you already have views from sdk.views.list().
|
|
368
|
-
*/
|
|
369
|
-
declare function createSdkRuntimeFromViews(views: ViewDefinition[], client: CogniteClient, telemetry?: SdkTelemetry): SdkRuntime;
|
|
370
|
-
|
|
371
|
-
export { type AggregateArgs, type AggregateMethod, type AggregateRequest, type AggregateRow, type ArrayElementOf, type CountArgs, type CountMethod, type DetailSelectArg, type GetByIdArgs, type GetByIdMethod, type ListItemOf, type ListMethod, type OpKind, type PageInfoOf, type PartialDetailResult, type PartialListResult, type QueryArgs, type SdkDispatcher, type SdkRuntime, type SearchArgs, type SelectArg, type SelectArgs, type SortInput, type ViewDefinition, type ViewDefinitionProperty, type WithArg, type WithSelection, createSdkDispatcher, createSdkRuntime, createSdkRuntimeFromViews };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-PZ2YS5FR.js";import"../chunk-ATR2SGLU.js";export{a as createSdkDispatcher,b as createSdkRuntime,c as createSdkRuntimeFromViews};
|