@xano/sdk 1.0.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 +788 -0
- package/LICENSE +21 -0
- package/README.md +541 -0
- package/dist/.build-fingerprint +1 -0
- package/dist/agent-file-refresh-ZEMK33AX.js +38 -0
- package/dist/answer-shape-K67TAAPY.js +33 -0
- package/dist/backend-dir-2U53CIAL.js +39 -0
- package/dist/backend-slot-7QXW2QYC.js +28 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +255 -0
- package/dist/branch-NCRNWQBQ.js +61 -0
- package/dist/branch-commands-ACIRCEQJ.js +79 -0
- package/dist/bundle.d.ts +223 -0
- package/dist/bundle.js +153 -0
- package/dist/capture-WAXPD7DR.js +41 -0
- package/dist/chunk-27GWNP2I.js +23 -0
- package/dist/chunk-2CMJZDCL.js +177 -0
- package/dist/chunk-2EZ3ZJZZ.js +302 -0
- package/dist/chunk-2GNFDZA2.js +390 -0
- package/dist/chunk-2MNLRIOX.js +11 -0
- package/dist/chunk-2TFRR6JV.js +104 -0
- package/dist/chunk-2ZUEE4EK.js +408 -0
- package/dist/chunk-36JUQZVQ.js +22 -0
- package/dist/chunk-3DRXWLJ5.js +83 -0
- package/dist/chunk-3JDU4VRL.js +137 -0
- package/dist/chunk-3KZCLN4Z.js +241 -0
- package/dist/chunk-3LDULPRE.js +168 -0
- package/dist/chunk-3M4LFYNQ.js +111 -0
- package/dist/chunk-3XI5CTUE.js +22 -0
- package/dist/chunk-3YW23UFH.js +50 -0
- package/dist/chunk-45UIT5T2.js +862 -0
- package/dist/chunk-4BW2SG2N.js +46 -0
- package/dist/chunk-4KHEMC32.js +79 -0
- package/dist/chunk-4POWHT2K.js +321 -0
- package/dist/chunk-4Q2GN7NW.js +192 -0
- package/dist/chunk-5A2PLKZB.js +70 -0
- package/dist/chunk-5FBYXK5P.js +159 -0
- package/dist/chunk-5HVXPTU4.js +323 -0
- package/dist/chunk-5QU2P5CA.js +304 -0
- package/dist/chunk-5V5XU32D.js +191 -0
- package/dist/chunk-5ZSO4T2G.js +10 -0
- package/dist/chunk-622HUCZT.js +10 -0
- package/dist/chunk-65HWOMGV.js +177 -0
- package/dist/chunk-6ELFRN3P.js +365 -0
- package/dist/chunk-6HO3NCSJ.js +1055 -0
- package/dist/chunk-6IUMKYWI.js +457 -0
- package/dist/chunk-6KEB3C3U.js +65 -0
- package/dist/chunk-6MR5TI5V.js +987 -0
- package/dist/chunk-6NNTNXN7.js +157 -0
- package/dist/chunk-6PBR37LN.js +97 -0
- package/dist/chunk-6QXLMMT3.js +155 -0
- package/dist/chunk-6ZGJCBZS.js +224 -0
- package/dist/chunk-73IVBKMA.js +250 -0
- package/dist/chunk-7G3CTU7I.js +286 -0
- package/dist/chunk-A3UDOZB6.js +222 -0
- package/dist/chunk-A6E77GDW.js +85 -0
- package/dist/chunk-AHJWCYQO.js +660 -0
- package/dist/chunk-AKNCFVKZ.js +36 -0
- package/dist/chunk-AM4FKL4J.js +237 -0
- package/dist/chunk-AN6BL47T.js +26 -0
- package/dist/chunk-AOSYVMUS.js +147 -0
- package/dist/chunk-APWXY5SL.js +182 -0
- package/dist/chunk-AWEIIR2U.js +218 -0
- package/dist/chunk-AWQ7BQTQ.js +73 -0
- package/dist/chunk-BAUZOWGX.js +393 -0
- package/dist/chunk-BHACRS6R.js +940 -0
- package/dist/chunk-BWPNT55T.js +680 -0
- package/dist/chunk-C6RIMRU4.js +187 -0
- package/dist/chunk-CGVQZXYG.js +263 -0
- package/dist/chunk-CIMQZRRE.js +162 -0
- package/dist/chunk-CJHQKJU4.js +113 -0
- package/dist/chunk-CTMO46PK.js +1897 -0
- package/dist/chunk-D53J55C5.js +106 -0
- package/dist/chunk-D7VGG3WS.js +90 -0
- package/dist/chunk-DAD3ONIS.js +245 -0
- package/dist/chunk-DGWHAVRG.js +162 -0
- package/dist/chunk-DX4QR4B2.js +483 -0
- package/dist/chunk-EHP3WPEG.js +21 -0
- package/dist/chunk-ELP2HMXC.js +432 -0
- package/dist/chunk-ERVIASGL.js +21 -0
- package/dist/chunk-ET4Y4XCB.js +865 -0
- package/dist/chunk-ETO6LGLD.js +4750 -0
- package/dist/chunk-EUUUMY7J.js +24 -0
- package/dist/chunk-FQJ2TTHP.js +218 -0
- package/dist/chunk-FQOF7E2E.js +133 -0
- package/dist/chunk-FWD7AL6N.js +21 -0
- package/dist/chunk-FXFV3KU6.js +138 -0
- package/dist/chunk-FXRQOWTE.js +171 -0
- package/dist/chunk-G554NZNI.js +210 -0
- package/dist/chunk-GSGDWJB5.js +13 -0
- package/dist/chunk-H2V3N23D.js +66 -0
- package/dist/chunk-H5C7MBCR.js +159 -0
- package/dist/chunk-HHN734BU.js +371 -0
- package/dist/chunk-HRVBLCVJ.js +243 -0
- package/dist/chunk-HVRUQXGD.js +1264 -0
- package/dist/chunk-I4F5TCJH.js +130 -0
- package/dist/chunk-IDOTCMDV.js +57 -0
- package/dist/chunk-IGOLHKWF.js +427 -0
- package/dist/chunk-JGE7CAWB.js +148 -0
- package/dist/chunk-JTUKLCXS.js +92 -0
- package/dist/chunk-JZGVVJSI.js +66 -0
- package/dist/chunk-K4WX6UUU.js +923 -0
- package/dist/chunk-K5BBGTYZ.js +217 -0
- package/dist/chunk-K6RXBGUB.js +427 -0
- package/dist/chunk-KTSDSD36.js +165 -0
- package/dist/chunk-L5JYN3NM.js +1038 -0
- package/dist/chunk-LIEOKXKD.js +354 -0
- package/dist/chunk-LLNZGEFK.js +51 -0
- package/dist/chunk-LPECSJ2J.js +55 -0
- package/dist/chunk-LQCMKAJ7.js +413 -0
- package/dist/chunk-LRN4ZJCQ.js +1145 -0
- package/dist/chunk-MJ4ZVHKN.js +17 -0
- package/dist/chunk-MXHSQOC4.js +3061 -0
- package/dist/chunk-N5GKCWE5.js +367 -0
- package/dist/chunk-NA3PXMEF.js +10 -0
- package/dist/chunk-NAQDMEHV.js +76 -0
- package/dist/chunk-NWKXM5RD.js +109 -0
- package/dist/chunk-NZOWWHU5.js +196 -0
- package/dist/chunk-OHX6MIUZ.js +184 -0
- package/dist/chunk-OOXWYAA4.js +15 -0
- package/dist/chunk-OPHB5ORL.js +1990 -0
- package/dist/chunk-OXA6PSZT.js +1725 -0
- package/dist/chunk-P2HAGF6H.js +73 -0
- package/dist/chunk-PTHVMXZI.js +3036 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-Q325JKYB.js +189 -0
- package/dist/chunk-Q7DGTQ5G.js +255 -0
- package/dist/chunk-QCNYHBL7.js +601 -0
- package/dist/chunk-QO6BVGS5.js +145 -0
- package/dist/chunk-QXTKSOFI.js +76 -0
- package/dist/chunk-ROY4YAEQ.js +66 -0
- package/dist/chunk-RTJRZFFY.js +447 -0
- package/dist/chunk-SAVJUS2X.js +128 -0
- package/dist/chunk-SFLHVCKX.js +173 -0
- package/dist/chunk-STSFNCY4.js +127 -0
- package/dist/chunk-SWBF2LTK.js +170 -0
- package/dist/chunk-T5KELPAR.js +109 -0
- package/dist/chunk-TFFGOFVZ.js +1481 -0
- package/dist/chunk-TLHIFK4M.js +256 -0
- package/dist/chunk-TLQE7ZN3.js +156 -0
- package/dist/chunk-TPHWJ7UG.js +1981 -0
- package/dist/chunk-TRJCALW3.js +291 -0
- package/dist/chunk-TTEIYD5P.js +133 -0
- package/dist/chunk-U64O2MXY.js +407 -0
- package/dist/chunk-UCQ2VUTG.js +630 -0
- package/dist/chunk-UTI5G6OJ.js +44 -0
- package/dist/chunk-UVHDMMIP.js +188 -0
- package/dist/chunk-UZ6QQWJT.js +120 -0
- package/dist/chunk-VAX3UZOY.js +686 -0
- package/dist/chunk-W3HBUKFO.js +57 -0
- package/dist/chunk-WKQLGKCL.js +2823 -0
- package/dist/chunk-WQFNASK4.js +560 -0
- package/dist/chunk-WRBKLYSJ.js +224 -0
- package/dist/chunk-WTPZRR4I.js +17 -0
- package/dist/chunk-WZDJ2LLX.js +2385 -0
- package/dist/chunk-X2NL4KUO.js +14 -0
- package/dist/chunk-X4DVXBFY.js +38 -0
- package/dist/chunk-X677DMZM.js +7050 -0
- package/dist/chunk-XBKMWY7F.js +612 -0
- package/dist/chunk-XNCP4KYO.js +78 -0
- package/dist/chunk-XVBGLISP.js +35 -0
- package/dist/chunk-XW6KISBB.js +1192 -0
- package/dist/chunk-YGZHHAAB.js +8156 -0
- package/dist/chunk-YHEFQUQB.js +186 -0
- package/dist/chunk-YLDALTWZ.js +653 -0
- package/dist/chunk-YU4HSQW7.js +229 -0
- package/dist/chunk-ZDPP6RKB.js +27 -0
- package/dist/chunk-ZFDZKNGG.js +194 -0
- package/dist/chunk-ZIY7RNUT.js +49 -0
- package/dist/chunk-ZYJP6BOO.js +30 -0
- package/dist/cli.d.ts +1111 -0
- package/dist/cli.js +165 -0
- package/dist/codegen-command-VR2GWR6C.js +173 -0
- package/dist/codegen.d.ts +115 -0
- package/dist/codegen.js +19 -0
- package/dist/commands-GJMJ4XYZ.js +76 -0
- package/dist/completion-ZQLO6PB6.js +738 -0
- package/dist/config-MBYGCAFK.js +136 -0
- package/dist/deploy-command-JVZPWHMK.js +180 -0
- package/dist/deploy-source-3W45CXMP.js +81 -0
- package/dist/dev-env-sync-HN44K4D5.js +188 -0
- package/dist/diagnostics-UEAAHWVF.js +30 -0
- package/dist/display-name-hint-ABBPVQIR.js +46 -0
- package/dist/emit-CyhBDxli.d.ts +7007 -0
- package/dist/env-example-refresh-ET5HMMDW.js +126 -0
- package/dist/env-pull-command-TNMNB3CV.js +323 -0
- package/dist/env-target-O4HRKTGZ.js +40 -0
- package/dist/env-var-command-ZIRDCAZA.js +427 -0
- package/dist/ephemeral-P7F3PMAD.js +54 -0
- package/dist/ephemeral-command-CLJJKOFT.js +592 -0
- package/dist/ephemeral-state-PYCBSOGX.js +61 -0
- package/dist/file-lock-PT74GWYW.js +10 -0
- package/dist/generate-command-AYEOLA26.js +510 -0
- package/dist/gitignore-3SJ3WNRG.js +51 -0
- package/dist/guards-4EBNCZDC.js +162 -0
- package/dist/hosted-file-PSHJB3HX.js +28 -0
- package/dist/impersonate-command-5JAS3WSV.js +152 -0
- package/dist/import-EQSFU6JC.js +19 -0
- package/dist/index.d.ts +5470 -0
- package/dist/index.js +371 -0
- package/dist/init-command-X2FR4UAK.js +125 -0
- package/dist/init-modules-RY7UHAOL.js +50 -0
- package/dist/init-web-M4YZSZK6.js +42 -0
- package/dist/internal.d.ts +179 -0
- package/dist/internal.js +2634 -0
- package/dist/io-RC56QSN5.js +26 -0
- package/dist/keep-data-merge-7MPLVAVI.js +1119 -0
- package/dist/lambda-config-reconcile-OUZ4OYAB.js +116 -0
- package/dist/landed-753YLJ5H.js +40 -0
- package/dist/landing-record-SU52SKXU.js +61 -0
- package/dist/live-diff-YONW2VI3.js +65 -0
- package/dist/local-engine-choice-CH5X3W7E.js +79 -0
- package/dist/local-engine-command-Z3OL7VOD.js +766 -0
- package/dist/local-engine-config-5U3SC434.js +39 -0
- package/dist/local-engine-deploy-PCQ4SNPB.js +39 -0
- package/dist/local-engine-process-EHTE5LLU.js +63 -0
- package/dist/local-engine-state-A4FTRFAF.js +32 -0
- package/dist/local-engine-update-check-6L645VBL.js +162 -0
- package/dist/lock-MRRHW5GS.js +87 -0
- package/dist/lock-commands-2QG25HL7.js +963 -0
- package/dist/login-command-QPYRWOXZ.js +538 -0
- package/dist/logout-command-WOIQLDP6.js +56 -0
- package/dist/loop-ALIZLOSX.js +191 -0
- package/dist/marketplace-command-K5YL42NO.js +977 -0
- package/dist/marketplace-resolve-LY32JES5.js +40 -0
- package/dist/meta-client-YXGPW53C.js +244 -0
- package/dist/module-manifest-JFGHU2TC.js +38 -0
- package/dist/near-key.d.ts +13 -0
- package/dist/near-key.js +8 -0
- package/dist/node.d.ts +95 -0
- package/dist/node.js +969 -0
- package/dist/operation-outcome-TZSESNC7.js +51 -0
- package/dist/output-target-AL3I44GG.js +47 -0
- package/dist/package-manager-PRAHUSCN.js +34 -0
- package/dist/plan-disclosure-6G4MLZKD.js +114 -0
- package/dist/plugin-contributions-WRNY5ABG.js +28 -0
- package/dist/plugin-prompt-4VA3B4FF.js +20 -0
- package/dist/plugin-questions-JTSYA74Q.js +24 -0
- package/dist/plugin.d.ts +396 -0
- package/dist/plugin.js +1 -0
- package/dist/preflight-command-2T5Z36MI.js +321 -0
- package/dist/profile-command-AH3PIM4X.js +800 -0
- package/dist/profile-pointer-GRWJU3YD.js +31 -0
- package/dist/profile-select-74TRDEPD.js +23 -0
- package/dist/project-dependency-KSH63ODT.js +35 -0
- package/dist/project-sdk-REPPOIBD.js +24 -0
- package/dist/promote-command-PCWT5N6S.js +140 -0
- package/dist/prompt-II3F3LND.js +27 -0
- package/dist/publish-command-TTDUUJI5.js +414 -0
- package/dist/pull-command-VBO7C4S3.js +161 -0
- package/dist/pull-superseded-GJWLG7XO.js +20 -0
- package/dist/release-command-N4ZPKMHR.js +146 -0
- package/dist/release-ns-command-3KFDMZ6G.js +1745 -0
- package/dist/response-HlXahv4K.d.ts +925 -0
- package/dist/retry-command-AS5EVREX.js +34 -0
- package/dist/routes-manifest-SNWUVBT6.js +43 -0
- package/dist/runtime-XETHVF33.js +14 -0
- package/dist/scaffold.d.ts +1911 -0
- package/dist/scaffold.js +107 -0
- package/dist/secrets-file-LVZD6IIM.js +56 -0
- package/dist/secrets-fill-command-TTCPSVXN.js +218 -0
- package/dist/seed-VU7C3QYS.js +46 -0
- package/dist/sent-writes-N7X4OVXT.js +22 -0
- package/dist/source-resolve-S2XA3XZF.js +83 -0
- package/dist/static-host-B2Y6AG3W.js +352 -0
- package/dist/status-command-RUDXTF7I.js +554 -0
- package/dist/store-6VNCD4D7.js +20 -0
- package/dist/store-ARM6VMO5.js +98 -0
- package/dist/store-DuYfzKlW.d.ts +3144 -0
- package/dist/suggest-6FOOYKHG.js +12 -0
- package/dist/sveltekit.d.ts +154 -0
- package/dist/sveltekit.js +109 -0
- package/dist/sync-contributions-UCEROO26.js +415 -0
- package/dist/table-ENAVMITR.js +42 -0
- package/dist/tables-command-GUPXXSB5.js +156 -0
- package/dist/tenant-IIHPOHGP.js +42 -0
- package/dist/tenant-command-D5HGI2X4.js +965 -0
- package/dist/test-command-TIKZMDPZ.js +476 -0
- package/dist/tests-BGGIOK3L.js +26 -0
- package/dist/token-NICJUTMT.js +72 -0
- package/dist/toolchain-hooks-GHKLUJOH.js +96 -0
- package/dist/toolchain-modules-5EAZUONB.js +24 -0
- package/dist/tracked-backend-EIBUMDZA.js +80 -0
- package/dist/update-check-2W2NLDTC.js +136 -0
- package/dist/upgrade-command-QHNFWM7O.js +531 -0
- package/dist/verify-rollout-DRCK5TDD.js +61 -0
- package/dist/whoami-command-STGINTXH.js +51 -0
- package/dist/workspace-2CLHU2LK.js +93 -0
- package/dist/workspace-binding-56PIIPCP.js +54 -0
- package/dist/workspace-command-JEXQETJD.js +535 -0
- package/dist/workspace-env-F2RFMSC5.js +70 -0
- package/dist/workspace-export-OJSH2HIW.js +21 -0
- package/dist/writable-VA7OISSK.js +25 -0
- package/dist/xano-ICFUSPFR.js +42 -0
- package/dist/xanosdk-import-GN42TO2B.js +56 -0
- package/dist/xanosdk-project-S6DXJONQ.js +41 -0
- package/dist/xdo-CxDr2Q1C.d.ts +1371 -0
- package/guides/README.md +33 -0
- package/guides/authoring.md +921 -0
- package/guides/cli.md +401 -0
- package/guides/codegen.md +177 -0
- package/guides/codes.md +404 -0
- package/guides/coverage.md +74 -0
- package/guides/deploying.md +1525 -0
- package/guides/environment.md +400 -0
- package/guides/marketplace.md +415 -0
- package/guides/module-contract.md +558 -0
- package/guides/object-kinds.md +433 -0
- package/guides/project-structure.md +43 -0
- package/guides/scaffold.md +351 -0
- package/guides/typed-frontend.md +242 -0
- package/llms/client.md +63 -0
- package/llms/errors.md +56 -0
- package/llms/fields.md +176 -0
- package/llms/filters.md +183 -0
- package/llms/kinds-agent-mcp.md +30 -0
- package/llms/kinds-core.md +100 -0
- package/llms/kinds-knowledge.md +20 -0
- package/llms/kinds-realtime.md +76 -0
- package/llms/lambda.md +94 -0
- package/llms/legacy.md +44 -0
- package/llms/lock.md +40 -0
- package/llms/object-kinds.md +34 -0
- package/llms/statements-calls.md +62 -0
- package/llms/statements-catalog.md +320 -0
- package/llms/statements-data.md +66 -0
- package/llms/statements-runtime.md +68 -0
- package/llms/tests.md +59 -0
- package/llms/toolchain.md +16 -0
- package/llms/triggers.md +36 -0
- package/llms/values.md +29 -0
- package/llms-full.txt +2085 -0
- package/llms.txt +493 -0
- package/manifest.json +11224 -0
- package/package.json +162 -0
- package/types/lambda-globals.d.ts +129 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import {
|
|
2
|
+
contextFlags
|
|
3
|
+
} from "./chunk-NAQDMEHV.js";
|
|
4
|
+
import {
|
|
5
|
+
backendDirFor,
|
|
6
|
+
backendDirIn
|
|
7
|
+
} from "./chunk-5A2PLKZB.js";
|
|
8
|
+
import {
|
|
9
|
+
projectRootFrom
|
|
10
|
+
} from "./chunk-ROY4YAEQ.js";
|
|
11
|
+
import {
|
|
12
|
+
atomicWrite
|
|
13
|
+
} from "./chunk-LLNZGEFK.js";
|
|
14
|
+
import {
|
|
15
|
+
LocalFileNotFoundError,
|
|
16
|
+
displayPath,
|
|
17
|
+
relForwardSlash
|
|
18
|
+
} from "./chunk-PTHVMXZI.js";
|
|
19
|
+
import {
|
|
20
|
+
normalizeDocumentationScopeKey
|
|
21
|
+
} from "./chunk-3JDU4VRL.js";
|
|
22
|
+
import {
|
|
23
|
+
shellQuote
|
|
24
|
+
} from "./chunk-5ZSO4T2G.js";
|
|
25
|
+
|
|
26
|
+
// src/emit/secrets-file.ts
|
|
27
|
+
import { randomBytes } from "crypto";
|
|
28
|
+
import { existsSync, readFileSync, realpathSync } from "fs";
|
|
29
|
+
import { dirname, join, resolve } from "path";
|
|
30
|
+
var SECRETS_FILE_VERSION = 1;
|
|
31
|
+
var DOCUMENTATION_TOKEN_BYTES = 20;
|
|
32
|
+
function generateDocumentationToken() {
|
|
33
|
+
return randomBytes(DOCUMENTATION_TOKEN_BYTES).toString("base64url");
|
|
34
|
+
}
|
|
35
|
+
function workspaceSecretsPathIn(cwd) {
|
|
36
|
+
return join(backendDirIn(projectRootFrom(cwd)), ".secrets.json");
|
|
37
|
+
}
|
|
38
|
+
function defaultWorkspaceSecretsPath(file) {
|
|
39
|
+
return join(backendDirFor(file), ".secrets.json");
|
|
40
|
+
}
|
|
41
|
+
function renderSecretsFile(file) {
|
|
42
|
+
return JSON.stringify(file, null, 2) + "\n";
|
|
43
|
+
}
|
|
44
|
+
function writeSecretsFile(path, file) {
|
|
45
|
+
atomicWrite(path, renderSecretsFile(file), { mode: 384 });
|
|
46
|
+
}
|
|
47
|
+
function entryWordFor(path) {
|
|
48
|
+
const entry = join(dirname(resolve(path)), "index.ts");
|
|
49
|
+
return existsSync(entry) ? entryWordOf(entry) : "";
|
|
50
|
+
}
|
|
51
|
+
function entryWordOf(entry) {
|
|
52
|
+
const real = (p) => {
|
|
53
|
+
try {
|
|
54
|
+
return realpathSync(p);
|
|
55
|
+
} catch {
|
|
56
|
+
return p;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const cwd = real(process.cwd());
|
|
60
|
+
const target = real(resolve(entry));
|
|
61
|
+
if (real(join(backendDirIn(cwd), "index.ts")) === target) return "";
|
|
62
|
+
const rel = relForwardSlash(cwd, target);
|
|
63
|
+
return ` ${shellQuote(rel === "" ? target : `./${rel}`)}`;
|
|
64
|
+
}
|
|
65
|
+
function readSecretsFile(path, label) {
|
|
66
|
+
const where = displayPath(path);
|
|
67
|
+
if (!existsSync(path)) {
|
|
68
|
+
if (label === void 0) return void 0;
|
|
69
|
+
throw new LocalFileNotFoundError(
|
|
70
|
+
`${label}: could not read ${where}. Check the path, and make sure the file is present wherever this runs (a CI secret mounted at deploy time, not a file committed to the repo).`
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
let parsed;
|
|
74
|
+
try {
|
|
75
|
+
parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
76
|
+
} catch {
|
|
77
|
+
throw new Error(
|
|
78
|
+
`${where} is not valid JSON. It is written by \`xanosdk pull\` and is not meant to be hand-edited \u2014 delete it and pull again to rebuild it.`
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
82
|
+
throw new Error(`${where} must be a JSON object. Delete it and pull again to rebuild it.`);
|
|
83
|
+
}
|
|
84
|
+
const record = parsed;
|
|
85
|
+
if (record.version !== SECRETS_FILE_VERSION) {
|
|
86
|
+
const what = record.version === void 0 ? `${where} has no \`version\` field, so it is not a file this SDK wrote` : `${where} is version ${JSON.stringify(record.version)}, and this SDK reads version ${SECRETS_FILE_VERSION}`;
|
|
87
|
+
throw new Error(
|
|
88
|
+
`${what}. Delete it, then run \`xanosdk secrets fill${entryWordFor(path)}\` to mint the tokens your source's gates declare, or \`xanosdk pull${contextFlags()}\` to store the target's existing ones.`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
const tokens = record.documentationTokens;
|
|
92
|
+
if (tokens === void 0 || tokens === null || typeof tokens !== "object" || Array.isArray(tokens)) {
|
|
93
|
+
throw new Error(
|
|
94
|
+
`${where} has no \`documentationTokens\` object. Delete it and pull again to rebuild it.`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
const out = /* @__PURE__ */ Object.create(null);
|
|
98
|
+
for (const [key, entry] of Object.entries(tokens)) {
|
|
99
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) {
|
|
100
|
+
throw new Error(
|
|
101
|
+
`${where}: the entry for ${JSON.stringify(key)} is not an object. Delete the file and pull again to rebuild it.`
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
const { value, label: label2 } = entry;
|
|
105
|
+
if (typeof value !== "string") {
|
|
106
|
+
throw new Error(
|
|
107
|
+
`${where}: the entry for ${JSON.stringify(key)} has no string \`value\`. Delete the file and pull again to rebuild it.`
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
out[normalizeDocumentationScopeKey(key)] = { value, label: typeof label2 === "string" && label2 !== "" ? label2 : key };
|
|
111
|
+
}
|
|
112
|
+
const provenance = record.pulledFrom;
|
|
113
|
+
return {
|
|
114
|
+
version: SECRETS_FILE_VERSION,
|
|
115
|
+
pulledFrom: provenance !== null && typeof provenance === "object" && !Array.isArray(provenance) ? provenance : { instance: "(unrecorded)", at: "(unrecorded)" },
|
|
116
|
+
documentationTokens: out
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export {
|
|
121
|
+
SECRETS_FILE_VERSION,
|
|
122
|
+
generateDocumentationToken,
|
|
123
|
+
workspaceSecretsPathIn,
|
|
124
|
+
defaultWorkspaceSecretsPath,
|
|
125
|
+
renderSecretsFile,
|
|
126
|
+
writeSecretsFile,
|
|
127
|
+
entryWordOf,
|
|
128
|
+
readSecretsFile
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=chunk-I4F5TCJH.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
questionOrCancel
|
|
3
|
+
} from "./chunk-65HWOMGV.js";
|
|
4
|
+
import {
|
|
5
|
+
style,
|
|
6
|
+
terminalText
|
|
7
|
+
} from "./chunk-PTHVMXZI.js";
|
|
8
|
+
|
|
9
|
+
// src/emit/plugin-prompt.ts
|
|
10
|
+
import { createInterface } from "readline/promises";
|
|
11
|
+
function canPrompt(opts = {}) {
|
|
12
|
+
if (opts.json === true) return false;
|
|
13
|
+
const stdin = opts.stdin ?? process.stdin;
|
|
14
|
+
const stderr = opts.stderr ?? process.stderr;
|
|
15
|
+
return stdin.isTTY === true && stderr.isTTY === true;
|
|
16
|
+
}
|
|
17
|
+
async function promptPluginQuestion(pkg, question, fallback, opts = {}) {
|
|
18
|
+
if (!canPrompt(opts)) return void 0;
|
|
19
|
+
const input = opts.stdin ?? process.stdin;
|
|
20
|
+
const output = opts.stderr ?? process.stderr;
|
|
21
|
+
const rl = createInterface({ input, output });
|
|
22
|
+
try {
|
|
23
|
+
output.write(terminalText(`
|
|
24
|
+
${question.label} ${style.dim(`(${pkg})`)}
|
|
25
|
+
`));
|
|
26
|
+
if (question.type === "boolean") {
|
|
27
|
+
const answer2 = (await questionOrCancel(rl, ` [Y/n] (default: ${fallback ? "yes" : "no"}): `, output)).trim().toLowerCase();
|
|
28
|
+
if (answer2 === "") return fallback;
|
|
29
|
+
return answer2 === "y" || answer2 === "yes";
|
|
30
|
+
}
|
|
31
|
+
if (question.type === "choice") {
|
|
32
|
+
const choices = question.choices ?? [];
|
|
33
|
+
output.write(choices.map((c, i) => ` ${i + 1}) ${c}`).join("\n") + "\n");
|
|
34
|
+
const answer2 = (await questionOrCancel(rl, ` Choose (default: ${String(fallback)}): `, output)).trim();
|
|
35
|
+
if (answer2 === "") return fallback;
|
|
36
|
+
const index = Number.parseInt(answer2, 10);
|
|
37
|
+
if (Number.isInteger(index) && index >= 1 && index <= choices.length) return choices[index - 1];
|
|
38
|
+
return choices.includes(answer2) ? answer2 : fallback;
|
|
39
|
+
}
|
|
40
|
+
const answer = (await questionOrCancel(rl, ` (default: ${String(fallback)}): `, output)).trim();
|
|
41
|
+
return answer === "" ? fallback : answer;
|
|
42
|
+
} finally {
|
|
43
|
+
rl.close();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function pluginPrompter(opts = {}) {
|
|
47
|
+
return {
|
|
48
|
+
ask: (pkg, question, fallback) => promptPluginQuestion(pkg, question, fallback, opts)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
canPrompt,
|
|
54
|
+
promptPluginQuestion,
|
|
55
|
+
pluginPrompter
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=chunk-IDOTCMDV.js.map
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fl
|
|
3
|
+
} from "./chunk-6HO3NCSJ.js";
|
|
4
|
+
import {
|
|
5
|
+
brandDef
|
|
6
|
+
} from "./chunk-ERVIASGL.js";
|
|
7
|
+
import {
|
|
8
|
+
nearestKey
|
|
9
|
+
} from "./chunk-WTPZRR4I.js";
|
|
10
|
+
import {
|
|
11
|
+
c
|
|
12
|
+
} from "./chunk-OXA6PSZT.js";
|
|
13
|
+
|
|
14
|
+
// src/function/define.ts
|
|
15
|
+
function defineFunction(def) {
|
|
16
|
+
if (!def.name || typeof def.name !== "string") {
|
|
17
|
+
throw new Error("defineFunction: `name` is required and must be a non-empty string.");
|
|
18
|
+
}
|
|
19
|
+
return brandDef(def, "function");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// src/fields/file-url.ts
|
|
23
|
+
function fileUrl(file, baseUrl) {
|
|
24
|
+
if (!file) return null;
|
|
25
|
+
if (typeof file.path === "string" && file.path !== "") {
|
|
26
|
+
const base = baseUrl.replace(/\/+$/, "");
|
|
27
|
+
return file.path.startsWith("/") ? base + file.path : `${base}/${file.path}`;
|
|
28
|
+
}
|
|
29
|
+
return typeof file.url === "string" && file.url !== "" ? file.url : null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// src/values/fl.ts
|
|
33
|
+
var FILTER_ALIASES = {
|
|
34
|
+
multiply: "mul",
|
|
35
|
+
times: "mul",
|
|
36
|
+
divide: "div",
|
|
37
|
+
subtract: "sub",
|
|
38
|
+
minus: "sub",
|
|
39
|
+
plus: "add",
|
|
40
|
+
modulo: "mod",
|
|
41
|
+
uppercase: "upper",
|
|
42
|
+
toupper: "upper",
|
|
43
|
+
touppercase: "upper",
|
|
44
|
+
lowercase: "lower",
|
|
45
|
+
tolower: "lower",
|
|
46
|
+
tolowercase: "lower",
|
|
47
|
+
len: "strlen",
|
|
48
|
+
includes: "contains",
|
|
49
|
+
startswith: "starts_with",
|
|
50
|
+
endswith: "ends_with",
|
|
51
|
+
replace: "string_replace",
|
|
52
|
+
replaceall: "string_replace",
|
|
53
|
+
tostring: "to_text",
|
|
54
|
+
tostr: "to_text",
|
|
55
|
+
parseint: "to_int",
|
|
56
|
+
tonumber: "to_decimal",
|
|
57
|
+
parsefloat: "to_decimal",
|
|
58
|
+
jsonparse: "json_decode",
|
|
59
|
+
jsonstringify: "json_encode",
|
|
60
|
+
stringify: "json_encode",
|
|
61
|
+
keys: "array_keys",
|
|
62
|
+
values: "array_values",
|
|
63
|
+
slice: "array_slice",
|
|
64
|
+
isempty: "empty"
|
|
65
|
+
};
|
|
66
|
+
function suggestFilter(name) {
|
|
67
|
+
const names = Object.keys(fl);
|
|
68
|
+
const alias = FILTER_ALIASES[name.toLowerCase().replace(/_/g, "")];
|
|
69
|
+
if (alias !== void 0 && names.includes(alias)) return alias;
|
|
70
|
+
return nearestKey(name, names);
|
|
71
|
+
}
|
|
72
|
+
var fl2 = /* @__PURE__ */ new Proxy(fl, {
|
|
73
|
+
get(target, prop, receiver) {
|
|
74
|
+
if (typeof prop !== "string" || prop in target || !/^[a-z]/i.test(prop)) return Reflect.get(target, prop, receiver);
|
|
75
|
+
const near = suggestFilter(prop);
|
|
76
|
+
if (near !== void 0) {
|
|
77
|
+
throw new Error(`fl.${prop} is not a filter \u2014 did you mean fl.${near}? Every filter is listed in manifest.json \`filters\`.`);
|
|
78
|
+
}
|
|
79
|
+
return Reflect.get(target, prop, receiver);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// src/values/generated/query-filters.generated.ts
|
|
84
|
+
var v = (x) => {
|
|
85
|
+
if (typeof x === "string") return c.text(x);
|
|
86
|
+
if (typeof x === "number") return Number.isInteger(x) ? c.int(x) : c.decimal(x);
|
|
87
|
+
if (typeof x === "boolean") return c.bool(x);
|
|
88
|
+
return x;
|
|
89
|
+
};
|
|
90
|
+
var step = (name, ...args) => args.length === 0 ? { name } : { name, arg: args.map(v) };
|
|
91
|
+
var QUERY_FILTER_NAMES = ["add", "array_length", "at_timezone", "avg", "between_filter", "ceil", "coalesce", "concat", "count", "count_distinct", "covers", "distance", "div", "epochms_add_day", "epochms_add_hour", "epochms_add_minute", "epochms_add_month", "epochms_add_sec", "epochms_add_year", "epochms_day", "epochms_dow", "epochms_doy", "epochms_epoch_day", "epochms_epoch_hour", "epochms_epoch_minute", "epochms_epoch_sec", "epochms_hour", "epochms_minute", "epochms_month", "epochms_sub_day", "epochms_sub_hour", "epochms_sub_minute", "epochms_sub_month", "epochms_sub_sec", "epochms_sub_year", "epochms_week", "epochms_year", "floor", "length", "lower", "max", "max_timestamp", "median", "min", "min_timestamp", "mul", "round", "search_rank", "sub", "substr", "sum", "time", "to_decimal", "to_distinct_list", "to_distinct_list_asc", "to_distinct_list_desc", "to_int", "to_list", "to_list_asc", "to_list_desc", "to_text", "to_timestamp", "unaccent", "upper", "vector_cos_distance", "vector_cos_similarity", "vector_hamming_distance", "vector_inner_product", "vector_jaccard_distance", "vector_l1_distance", "vector_l2_distance", "vector_negative_inner_product", "within"];
|
|
92
|
+
var QUERY_AGGREGATE_NAMES = ["avg", "count", "count_distinct", "max", "max_timestamp", "median", "min", "min_timestamp", "sum", "to_distinct_list", "to_distinct_list_asc", "to_distinct_list_desc", "to_list", "to_list_asc", "to_list_desc"];
|
|
93
|
+
var QUERY_FILTER_SPECS = { "add": { "kind": "filter", "args": [{ "name": "value", "type": "decimal" }], "arity": 1, "result": "decimal", "entry": ["int", "decimal"] }, "array_length": { "kind": "filter", "args": [], "arity": 0, "result": "int" }, "at_timezone": { "kind": "filter", "args": [{ "name": "value", "type": "text" }], "arity": 1, "result": "timestamp", "entry": ["timestamp"] }, "avg": { "kind": "aggregate", "args": [], "arity": 0, "result": "decimal", "entry": ["int[]", "decimal[]"] }, "between_filter": { "kind": "filter", "args": [{ "name": "left", "type": "any" }, { "name": "right", "type": "any" }], "arity": 2, "result": "bool", "entry": ["decimal", "int", "timestamp", "epochms"] }, "ceil": { "kind": "filter", "args": [], "arity": 0, "result": "int", "entry": ["decimal", "int"] }, "coalesce": { "kind": "filter", "args": [{ "name": "value", "type": "json" }], "arity": 1, "result": "json", "entry": ["json"] }, "concat": { "kind": "filter", "args": [{ "name": "value", "type": "json" }], "arity": 1, "result": "text", "entry": ["text", "int", "decimal", "boolean"] }, "count": { "kind": "aggregate", "args": [], "arity": 0, "result": "int", "entry": ["int[]", "decimal[]"] }, "count_distinct": { "kind": "aggregate", "args": [], "arity": 0, "result": "int", "entry": ["int[]", "decimal[]"] }, "covers": { "kind": "filter", "args": [{ "name": "point", "type": "geo_point" }], "arity": 1, "result": "bool", "entry": ["geo_point", "geo_multipoint", "geo_linestring", "geo_multilinestring", "geo_polygon", "geo_multipolygon"] }, "distance": { "kind": "filter", "args": [{ "name": "point", "type": "geo_point" }], "arity": 1, "result": "decimal", "entry": ["geo_point", "geo_multipoint", "geo_linestring", "geo_multilinestring", "geo_polygon", "geo_multipolygon"] }, "div": { "kind": "filter", "args": [{ "name": "value", "type": "decimal" }], "arity": 1, "result": "decimal", "entry": ["int", "decimal"] }, "epochms_add_day": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_add_hour": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_add_minute": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_add_month": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_add_sec": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_add_year": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_day": { "kind": "filter", "args": [{ "name": "timezone", "type": "text" }], "arity": 1, "result": "int", "entry": ["epochms"] }, "epochms_dow": { "kind": "filter", "args": [{ "name": "timezone", "type": "text" }], "arity": 1, "result": "int", "entry": ["epochms"] }, "epochms_doy": { "kind": "filter", "args": [{ "name": "timezone", "type": "text" }], "arity": 1, "result": "int", "entry": ["epochms"] }, "epochms_epoch_day": { "kind": "filter", "args": [], "arity": 0, "result": "int", "entry": ["epochms"] }, "epochms_epoch_hour": { "kind": "filter", "args": [], "arity": 0, "result": "int", "entry": ["epochms"] }, "epochms_epoch_minute": { "kind": "filter", "args": [], "arity": 0, "result": "int", "entry": ["epochms"] }, "epochms_epoch_sec": { "kind": "filter", "args": [], "arity": 0, "result": "int", "entry": ["epochms"] }, "epochms_hour": { "kind": "filter", "args": [{ "name": "timezone", "type": "text" }], "arity": 1, "result": "int", "entry": ["epochms"] }, "epochms_minute": { "kind": "filter", "args": [{ "name": "timezone", "type": "text" }], "arity": 1, "result": "int", "entry": ["epochms"] }, "epochms_month": { "kind": "filter", "args": [{ "name": "timezone", "type": "text" }], "arity": 1, "result": "int", "entry": ["epochms"] }, "epochms_sub_day": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_sub_hour": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_sub_minute": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_sub_month": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_sub_sec": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_sub_year": { "kind": "filter", "args": [{ "name": "amount", "type": "decimal" }], "arity": 1, "result": "epochms", "entry": ["epochms"] }, "epochms_week": { "kind": "filter", "args": [{ "name": "timezone", "type": "text" }], "arity": 1, "result": "int", "entry": ["epochms"] }, "epochms_year": { "kind": "filter", "args": [{ "name": "timezone", "type": "text" }], "arity": 1, "result": "int", "entry": ["epochms"] }, "floor": { "kind": "filter", "args": [], "arity": 0, "result": "int", "entry": ["decimal", "int"] }, "length": { "kind": "filter", "args": [], "arity": 0, "result": "int", "entry": ["text"] }, "lower": { "kind": "filter", "args": [], "arity": 0, "result": "text", "entry": ["text", "enum"] }, "max": { "kind": "aggregate", "args": [], "arity": 0, "result": "decimal", "entry": ["int[]", "decimal[]"] }, "max_timestamp": { "kind": "aggregate", "args": [], "arity": 0, "result": "timestamp", "entry": ["timestamp[]"] }, "median": { "kind": "aggregate", "args": [], "arity": 0, "result": "decimal", "entry": ["int[]", "decimal[]"] }, "min": { "kind": "aggregate", "args": [], "arity": 0, "result": "decimal", "entry": ["int[]", "decimal[]"] }, "min_timestamp": { "kind": "aggregate", "args": [], "arity": 0, "result": "timestamp", "entry": ["timestamp[]"] }, "mul": { "kind": "filter", "args": [{ "name": "value", "type": "decimal" }], "arity": 1, "result": "decimal", "entry": ["int", "decimal"] }, "round": { "kind": "filter", "args": [{ "name": "precision", "type": "int" }], "arity": 1, "result": "decimal", "entry": ["decimal", "int"] }, "search_rank": { "kind": "filter", "args": [{ "name": "q", "type": "text" }], "arity": 1, "result": "decimal", "entry": ["search"] }, "sub": { "kind": "filter", "args": [{ "name": "value", "type": "decimal" }], "arity": 1, "result": "decimal", "entry": ["int", "decimal"] }, "substr": { "kind": "filter", "args": [{ "name": "start", "type": "int" }, { "name": "length", "type": "int" }], "arity": 2, "result": "text", "entry": ["text"] }, "sum": { "kind": "aggregate", "args": [], "arity": 0, "result": "decimal", "entry": ["int[]", "decimal[]"] }, "time": { "kind": "filter", "args": [{ "name": "option", "type": "enum", "enum": ["century", "day", "decade", "dow", "doy", "epoch", "hour", "isodow", "isoyear", "microseconds", "millennium", "milliseconds", "minute", "month", "quarter", "second", "timezone", "timezone_hour", "timezone_minute", "week", "year"] }], "arity": 1, "result": "decimal", "entry": ["timestamp"] }, "to_decimal": { "kind": "filter", "args": [], "arity": 0, "result": "decimal", "entry": ["text"] }, "to_distinct_list": { "kind": "aggregate", "args": [], "arity": 0, "result": "json", "entry": ["int[]", "decimal[]"] }, "to_distinct_list_asc": { "kind": "aggregate", "args": [], "arity": 0, "result": "json", "entry": ["int[]", "decimal[]"] }, "to_distinct_list_desc": { "kind": "aggregate", "args": [], "arity": 0, "result": "json", "entry": ["int[]", "decimal[]"] }, "to_int": { "kind": "filter", "args": [], "arity": 0, "result": "int", "entry": ["text", "bool"] }, "to_list": { "kind": "aggregate", "args": [], "arity": 0, "result": "json", "entry": ["int[]", "decimal[]"] }, "to_list_asc": { "kind": "aggregate", "args": [], "arity": 0, "result": "json", "entry": ["int[]", "decimal[]"] }, "to_list_desc": { "kind": "aggregate", "args": [], "arity": 0, "result": "json", "entry": ["int[]", "decimal[]"] }, "to_text": { "kind": "filter", "args": [], "arity": 0, "result": "text", "entry": ["bool", "int", "decimal", "timestamp", "json"] }, "to_timestamp": { "kind": "filter", "args": [], "arity": 0, "result": "timestamp", "entry": ["text", "json", "int", "decimal"] }, "unaccent": { "kind": "filter", "args": [], "arity": 0, "result": "text", "entry": ["text", "enum"] }, "upper": { "kind": "filter", "args": [], "arity": 0, "result": "text", "entry": ["text", "enum"] }, "vector_cos_distance": { "kind": "filter", "args": [{ "name": "vector", "type": "decimal[]" }], "arity": 1, "result": "decimal", "entry": ["decimal[]", "int[]"] }, "vector_cos_similarity": { "kind": "filter", "args": [{ "name": "vector", "type": "decimal[]" }], "arity": 1, "result": "decimal", "entry": ["decimal[]", "int[]"] }, "vector_hamming_distance": { "kind": "filter", "args": [{ "name": "vector", "type": "decimal[]" }], "arity": 1, "result": "decimal", "entry": ["decimal[]", "int[]"] }, "vector_inner_product": { "kind": "filter", "args": [{ "name": "vector", "type": "decimal[]" }], "arity": 1, "result": "decimal", "entry": ["decimal[]", "int[]"] }, "vector_jaccard_distance": { "kind": "filter", "args": [{ "name": "vector", "type": "decimal[]" }], "arity": 1, "result": "decimal", "entry": ["decimal[]", "int[]"] }, "vector_l1_distance": { "kind": "filter", "args": [{ "name": "vector", "type": "decimal[]" }], "arity": 1, "result": "decimal", "entry": ["decimal[]", "int[]"] }, "vector_l2_distance": { "kind": "filter", "args": [{ "name": "vector", "type": "decimal[]" }], "arity": 1, "result": "decimal", "entry": ["decimal[]", "int[]"] }, "vector_negative_inner_product": { "kind": "filter", "args": [{ "name": "vector", "type": "decimal[]" }], "arity": 1, "result": "decimal", "entry": ["decimal[]", "int[]"] }, "within": { "kind": "filter", "args": [{ "name": "point", "type": "geo_point" }, { "name": "radius", "type": "decimal" }], "arity": 2, "result": "bool", "entry": ["geo_point", "geo_multipoint", "geo_linestring", "geo_multilinestring", "geo_polygon", "geo_multipolygon"] } };
|
|
94
|
+
var qf = {
|
|
95
|
+
"add": (
|
|
96
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: int | decimal. Result: decimal. */
|
|
97
|
+
(value) => step("add", value)
|
|
98
|
+
),
|
|
99
|
+
"array_length": (
|
|
100
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Result: int. */
|
|
101
|
+
() => step("array_length")
|
|
102
|
+
),
|
|
103
|
+
"at_timezone": (
|
|
104
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: timestamp. Result: timestamp. */
|
|
105
|
+
(value) => step("at_timezone", value)
|
|
106
|
+
),
|
|
107
|
+
"avg": (
|
|
108
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: decimal. */
|
|
109
|
+
() => step("avg")
|
|
110
|
+
),
|
|
111
|
+
"between_filter": (
|
|
112
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal | int | timestamp | epochms. Result: bool. */
|
|
113
|
+
(left, right) => step("between_filter", left, right)
|
|
114
|
+
),
|
|
115
|
+
"ceil": (
|
|
116
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal | int. Result: int. */
|
|
117
|
+
() => step("ceil")
|
|
118
|
+
),
|
|
119
|
+
"coalesce": (
|
|
120
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: json. Result: json. */
|
|
121
|
+
(value) => step("coalesce", value)
|
|
122
|
+
),
|
|
123
|
+
"concat": (
|
|
124
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: text | int | decimal | boolean. Result: text. */
|
|
125
|
+
(value) => step("concat", value)
|
|
126
|
+
),
|
|
127
|
+
"count": (
|
|
128
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: int. */
|
|
129
|
+
() => step("count")
|
|
130
|
+
),
|
|
131
|
+
"count_distinct": (
|
|
132
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: int. */
|
|
133
|
+
() => step("count_distinct")
|
|
134
|
+
),
|
|
135
|
+
"covers": (
|
|
136
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: geo_point | geo_multipoint | geo_linestring | geo_multilinestring | geo_polygon | geo_multipolygon. Result: bool. */
|
|
137
|
+
(point) => step("covers", point)
|
|
138
|
+
),
|
|
139
|
+
"distance": (
|
|
140
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: geo_point | geo_multipoint | geo_linestring | geo_multilinestring | geo_polygon | geo_multipolygon. Result: decimal. */
|
|
141
|
+
(point) => step("distance", point)
|
|
142
|
+
),
|
|
143
|
+
"div": (
|
|
144
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: int | decimal. Result: decimal. */
|
|
145
|
+
(value) => step("div", value)
|
|
146
|
+
),
|
|
147
|
+
"epochms_add_day": (
|
|
148
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
149
|
+
(amount) => step("epochms_add_day", amount)
|
|
150
|
+
),
|
|
151
|
+
"epochms_add_hour": (
|
|
152
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
153
|
+
(amount) => step("epochms_add_hour", amount)
|
|
154
|
+
),
|
|
155
|
+
"epochms_add_minute": (
|
|
156
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
157
|
+
(amount) => step("epochms_add_minute", amount)
|
|
158
|
+
),
|
|
159
|
+
"epochms_add_month": (
|
|
160
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
161
|
+
(amount) => step("epochms_add_month", amount)
|
|
162
|
+
),
|
|
163
|
+
"epochms_add_sec": (
|
|
164
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
165
|
+
(amount) => step("epochms_add_sec", amount)
|
|
166
|
+
),
|
|
167
|
+
"epochms_add_year": (
|
|
168
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
169
|
+
(amount) => step("epochms_add_year", amount)
|
|
170
|
+
),
|
|
171
|
+
"epochms_day": (
|
|
172
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
173
|
+
(timezone) => step("epochms_day", timezone)
|
|
174
|
+
),
|
|
175
|
+
"epochms_dow": (
|
|
176
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
177
|
+
(timezone) => step("epochms_dow", timezone)
|
|
178
|
+
),
|
|
179
|
+
"epochms_doy": (
|
|
180
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
181
|
+
(timezone) => step("epochms_doy", timezone)
|
|
182
|
+
),
|
|
183
|
+
"epochms_epoch_day": (
|
|
184
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
185
|
+
() => step("epochms_epoch_day")
|
|
186
|
+
),
|
|
187
|
+
"epochms_epoch_hour": (
|
|
188
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
189
|
+
() => step("epochms_epoch_hour")
|
|
190
|
+
),
|
|
191
|
+
"epochms_epoch_minute": (
|
|
192
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
193
|
+
() => step("epochms_epoch_minute")
|
|
194
|
+
),
|
|
195
|
+
"epochms_epoch_sec": (
|
|
196
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
197
|
+
() => step("epochms_epoch_sec")
|
|
198
|
+
),
|
|
199
|
+
"epochms_hour": (
|
|
200
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
201
|
+
(timezone) => step("epochms_hour", timezone)
|
|
202
|
+
),
|
|
203
|
+
"epochms_minute": (
|
|
204
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
205
|
+
(timezone) => step("epochms_minute", timezone)
|
|
206
|
+
),
|
|
207
|
+
"epochms_month": (
|
|
208
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
209
|
+
(timezone) => step("epochms_month", timezone)
|
|
210
|
+
),
|
|
211
|
+
"epochms_sub_day": (
|
|
212
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
213
|
+
(amount) => step("epochms_sub_day", amount)
|
|
214
|
+
),
|
|
215
|
+
"epochms_sub_hour": (
|
|
216
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
217
|
+
(amount) => step("epochms_sub_hour", amount)
|
|
218
|
+
),
|
|
219
|
+
"epochms_sub_minute": (
|
|
220
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
221
|
+
(amount) => step("epochms_sub_minute", amount)
|
|
222
|
+
),
|
|
223
|
+
"epochms_sub_month": (
|
|
224
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
225
|
+
(amount) => step("epochms_sub_month", amount)
|
|
226
|
+
),
|
|
227
|
+
"epochms_sub_sec": (
|
|
228
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
229
|
+
(amount) => step("epochms_sub_sec", amount)
|
|
230
|
+
),
|
|
231
|
+
"epochms_sub_year": (
|
|
232
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: epochms. */
|
|
233
|
+
(amount) => step("epochms_sub_year", amount)
|
|
234
|
+
),
|
|
235
|
+
"epochms_week": (
|
|
236
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
237
|
+
(timezone) => step("epochms_week", timezone)
|
|
238
|
+
),
|
|
239
|
+
"epochms_year": (
|
|
240
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: epochms. Result: int. */
|
|
241
|
+
(timezone) => step("epochms_year", timezone)
|
|
242
|
+
),
|
|
243
|
+
"floor": (
|
|
244
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal | int. Result: int. */
|
|
245
|
+
() => step("floor")
|
|
246
|
+
),
|
|
247
|
+
"length": (
|
|
248
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: text. Result: int. */
|
|
249
|
+
() => step("length")
|
|
250
|
+
),
|
|
251
|
+
"lower": (
|
|
252
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: text | enum. Result: text. */
|
|
253
|
+
() => step("lower")
|
|
254
|
+
),
|
|
255
|
+
"max": (
|
|
256
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: decimal. */
|
|
257
|
+
() => step("max")
|
|
258
|
+
),
|
|
259
|
+
"max_timestamp": (
|
|
260
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: timestamp[]. Result: timestamp. */
|
|
261
|
+
() => step("max_timestamp")
|
|
262
|
+
),
|
|
263
|
+
"median": (
|
|
264
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: decimal. */
|
|
265
|
+
() => step("median")
|
|
266
|
+
),
|
|
267
|
+
"min": (
|
|
268
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: decimal. */
|
|
269
|
+
() => step("min")
|
|
270
|
+
),
|
|
271
|
+
"min_timestamp": (
|
|
272
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: timestamp[]. Result: timestamp. */
|
|
273
|
+
() => step("min_timestamp")
|
|
274
|
+
),
|
|
275
|
+
"mul": (
|
|
276
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: int | decimal. Result: decimal. */
|
|
277
|
+
(value) => step("mul", value)
|
|
278
|
+
),
|
|
279
|
+
"round": (
|
|
280
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal | int. Result: decimal. */
|
|
281
|
+
(precision) => step("round", precision)
|
|
282
|
+
),
|
|
283
|
+
"search_rank": (
|
|
284
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: search. Result: decimal. */
|
|
285
|
+
(q) => step("search_rank", q)
|
|
286
|
+
),
|
|
287
|
+
"sub": (
|
|
288
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: int | decimal. Result: decimal. */
|
|
289
|
+
(value) => step("sub", value)
|
|
290
|
+
),
|
|
291
|
+
"substr": (
|
|
292
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: text. Result: text. */
|
|
293
|
+
(start, length) => step("substr", start, length)
|
|
294
|
+
),
|
|
295
|
+
"sum": (
|
|
296
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: decimal. */
|
|
297
|
+
() => step("sum")
|
|
298
|
+
),
|
|
299
|
+
"time": (
|
|
300
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: timestamp. Result: decimal. */
|
|
301
|
+
(option) => step("time", option)
|
|
302
|
+
),
|
|
303
|
+
"to_decimal": (
|
|
304
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: text. Result: decimal. */
|
|
305
|
+
() => step("to_decimal")
|
|
306
|
+
),
|
|
307
|
+
"to_distinct_list": (
|
|
308
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: json. */
|
|
309
|
+
() => step("to_distinct_list")
|
|
310
|
+
),
|
|
311
|
+
"to_distinct_list_asc": (
|
|
312
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: json. */
|
|
313
|
+
() => step("to_distinct_list_asc")
|
|
314
|
+
),
|
|
315
|
+
"to_distinct_list_desc": (
|
|
316
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: json. */
|
|
317
|
+
() => step("to_distinct_list_desc")
|
|
318
|
+
),
|
|
319
|
+
"to_int": (
|
|
320
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: text | bool. Result: int. */
|
|
321
|
+
() => step("to_int")
|
|
322
|
+
),
|
|
323
|
+
"to_list": (
|
|
324
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: json. */
|
|
325
|
+
() => step("to_list")
|
|
326
|
+
),
|
|
327
|
+
"to_list_asc": (
|
|
328
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: json. */
|
|
329
|
+
() => step("to_list_asc")
|
|
330
|
+
),
|
|
331
|
+
"to_list_desc": (
|
|
332
|
+
/** SQL AGGREGATE — valid only in an aggregate query's `eval`/`group`, computed by the database over the grouped result. Piped value: int[] | decimal[]. Result: json. */
|
|
333
|
+
() => step("to_list_desc")
|
|
334
|
+
),
|
|
335
|
+
"to_text": (
|
|
336
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: bool | int | decimal | timestamp | json. Result: text. */
|
|
337
|
+
() => step("to_text")
|
|
338
|
+
),
|
|
339
|
+
"to_timestamp": (
|
|
340
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: text | json | int | decimal. Result: timestamp. */
|
|
341
|
+
() => step("to_timestamp")
|
|
342
|
+
),
|
|
343
|
+
"unaccent": (
|
|
344
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: text | enum. Result: text. */
|
|
345
|
+
() => step("unaccent")
|
|
346
|
+
),
|
|
347
|
+
"upper": (
|
|
348
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: text | enum. Result: text. */
|
|
349
|
+
() => step("upper")
|
|
350
|
+
),
|
|
351
|
+
"vector_cos_distance": (
|
|
352
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal[] | int[]. Result: decimal. */
|
|
353
|
+
(vector) => step("vector_cos_distance", vector)
|
|
354
|
+
),
|
|
355
|
+
"vector_cos_similarity": (
|
|
356
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal[] | int[]. Result: decimal. */
|
|
357
|
+
(vector) => step("vector_cos_similarity", vector)
|
|
358
|
+
),
|
|
359
|
+
"vector_hamming_distance": (
|
|
360
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal[] | int[]. Result: decimal. */
|
|
361
|
+
(vector) => step("vector_hamming_distance", vector)
|
|
362
|
+
),
|
|
363
|
+
"vector_inner_product": (
|
|
364
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal[] | int[]. Result: decimal. */
|
|
365
|
+
(vector) => step("vector_inner_product", vector)
|
|
366
|
+
),
|
|
367
|
+
"vector_jaccard_distance": (
|
|
368
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal[] | int[]. Result: decimal. */
|
|
369
|
+
(vector) => step("vector_jaccard_distance", vector)
|
|
370
|
+
),
|
|
371
|
+
"vector_l1_distance": (
|
|
372
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal[] | int[]. Result: decimal. */
|
|
373
|
+
(vector) => step("vector_l1_distance", vector)
|
|
374
|
+
),
|
|
375
|
+
"vector_l2_distance": (
|
|
376
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal[] | int[]. Result: decimal. */
|
|
377
|
+
(vector) => step("vector_l2_distance", vector)
|
|
378
|
+
),
|
|
379
|
+
"vector_negative_inner_product": (
|
|
380
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: decimal[] | int[]. Result: decimal. */
|
|
381
|
+
(vector) => step("vector_negative_inner_product", vector)
|
|
382
|
+
),
|
|
383
|
+
"within": (
|
|
384
|
+
/** Compiled into SQL, so it resolves only in a db-query `eval`, `sort` or `where` — never in a value `filters[]` pipeline. Piped value: geo_point | geo_multipoint | geo_linestring | geo_multilinestring | geo_polygon | geo_multipolygon. Result: bool. */
|
|
385
|
+
(point, radius) => step("within", point, radius)
|
|
386
|
+
)
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
// src/util/duration.ts
|
|
390
|
+
var UNIT_SECONDS = {
|
|
391
|
+
s: 1,
|
|
392
|
+
m: 60,
|
|
393
|
+
h: 3600,
|
|
394
|
+
d: 86400,
|
|
395
|
+
w: 604800
|
|
396
|
+
};
|
|
397
|
+
var TERM = /(\d+)([smhdw])/g;
|
|
398
|
+
var WHOLE = /^(\d+[smhdw])+$/;
|
|
399
|
+
function every(duration) {
|
|
400
|
+
if (!WHOLE.test(duration)) {
|
|
401
|
+
throw new Error(
|
|
402
|
+
`every(${JSON.stringify(duration)}): not a duration. Write one or more <number><unit> terms with no spaces \u2014 "30s", "15m", "1h", "7d", "2w", "1h30m". Units are s/m/h/d/w; there is no month or year unit because neither is a fixed number of seconds. For a plain second count, pass the number itself.`
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
let total = 0;
|
|
406
|
+
for (const match of duration.matchAll(TERM)) {
|
|
407
|
+
total += Number(match[1]) * UNIT_SECONDS[match[2]];
|
|
408
|
+
}
|
|
409
|
+
if (total === 0) {
|
|
410
|
+
throw new Error(
|
|
411
|
+
`every(${JSON.stringify(duration)}) is zero seconds. A repeat frequency of 0 is not a schedule \u2014 the task would re-fire as fast as the scheduler dequeues it.`
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
return total;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export {
|
|
418
|
+
defineFunction,
|
|
419
|
+
fileUrl,
|
|
420
|
+
fl2 as fl,
|
|
421
|
+
QUERY_FILTER_NAMES,
|
|
422
|
+
QUERY_AGGREGATE_NAMES,
|
|
423
|
+
QUERY_FILTER_SPECS,
|
|
424
|
+
qf,
|
|
425
|
+
every
|
|
426
|
+
};
|
|
427
|
+
//# sourceMappingURL=chunk-IGOLHKWF.js.map
|