scorecard-ai 3.1.0 → 3.2.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 +70 -0
- package/api-promise.d.mts +1 -0
- package/api-promise.d.mts.map +1 -1
- package/api-promise.d.ts +1 -0
- package/api-promise.d.ts.map +1 -1
- package/api-promise.mjs +1 -0
- package/api-promise.mjs.map +1 -1
- package/client.d.mts +1 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +1 -4
- package/client.d.ts.map +1 -1
- package/client.js +21 -5
- package/client.js.map +1 -1
- package/client.mjs +21 -5
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.mjs.map +1 -1
- package/error.d.mts +1 -0
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -0
- package/error.d.ts.map +1 -1
- package/error.mjs +1 -0
- package/error.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.d.mts +6 -0
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +6 -0
- package/internal/shims.d.ts.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/types.d.mts +10 -10
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +10 -10
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -0
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.d.mts +0 -3
- package/internal/utils/query.d.mts.map +1 -1
- package/internal/utils/query.d.ts +0 -3
- package/internal/utils/query.d.ts.map +1 -1
- package/internal/utils/query.js +3 -16
- package/internal/utils/query.js.map +1 -1
- package/internal/utils/query.mjs +2 -16
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.mjs.map +1 -1
- package/lib/runAndEvaluate.d.mts.map +1 -1
- package/lib/runAndEvaluate.d.ts.map +1 -1
- package/lib/runAndEvaluate.mjs.map +1 -1
- package/lib/wrapAISDK.mjs.map +1 -1
- package/lib/wrapLLMs.mjs.map +1 -1
- package/package.json +14 -20
- package/pagination.d.mts +1 -0
- package/pagination.d.mts.map +1 -1
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.mjs +1 -0
- package/pagination.mjs.map +1 -1
- package/resource.d.mts +1 -0
- package/resource.d.mts.map +1 -1
- package/resource.d.ts +1 -0
- package/resource.d.ts.map +1 -1
- package/resource.mjs +1 -0
- package/resource.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/metrics.d.mts.map +1 -1
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.mjs.map +1 -1
- package/resources/projects.d.mts.map +1 -1
- package/resources/projects.d.ts.map +1 -1
- package/resources/projects.mjs.map +1 -1
- package/resources/records/annotations.d.mts +58 -0
- package/resources/records/annotations.d.mts.map +1 -0
- package/resources/records/annotations.d.ts +58 -0
- package/resources/records/annotations.d.ts.map +1 -0
- package/resources/records/annotations.js +23 -0
- package/resources/records/annotations.js.map +1 -0
- package/resources/records/annotations.mjs +19 -0
- package/resources/records/annotations.mjs.map +1 -0
- package/resources/records/index.d.mts +4 -0
- package/resources/records/index.d.mts.map +1 -0
- package/resources/records/index.d.ts +4 -0
- package/resources/records/index.d.ts.map +1 -0
- package/resources/records/index.js +11 -0
- package/resources/records/index.js.map +1 -0
- package/resources/records/index.mjs +5 -0
- package/resources/records/index.mjs.map +1 -0
- package/resources/records/records.d.mts +148 -0
- package/resources/records/records.d.mts.map +1 -0
- package/resources/records/records.d.ts +148 -0
- package/resources/records/records.d.ts.map +1 -0
- package/resources/records/records.js +72 -0
- package/resources/records/records.js.map +1 -0
- package/resources/records/records.mjs +67 -0
- package/resources/records/records.mjs.map +1 -0
- package/resources/records/tags.d.mts +93 -0
- package/resources/records/tags.d.mts.map +1 -0
- package/resources/records/tags.d.ts +93 -0
- package/resources/records/tags.d.ts.map +1 -0
- package/resources/records/tags.js +49 -0
- package/resources/records/tags.js.map +1 -0
- package/resources/records/tags.mjs +45 -0
- package/resources/records/tags.mjs.map +1 -0
- package/resources/records.d.mts +1 -134
- package/resources/records.d.mts.map +1 -1
- package/resources/records.d.ts +1 -134
- package/resources/records.d.ts.map +1 -1
- package/resources/records.js +2 -56
- package/resources/records.js.map +1 -1
- package/resources/records.mjs +1 -54
- package/resources/records.mjs.map +1 -1
- package/resources/runs.d.mts.map +1 -1
- package/resources/runs.d.ts.map +1 -1
- package/resources/runs.mjs.map +1 -1
- package/resources/scores.d.mts.map +1 -1
- package/resources/scores.d.ts.map +1 -1
- package/resources/scores.mjs.map +1 -1
- package/resources/systems/index.d.mts.map +1 -1
- package/resources/systems/index.d.ts.map +1 -1
- package/resources/systems/index.mjs.map +1 -1
- package/resources/systems/systems.d.mts.map +1 -1
- package/resources/systems/systems.d.ts.map +1 -1
- package/resources/systems/systems.mjs.map +1 -1
- package/resources/systems/versions.d.mts.map +1 -1
- package/resources/systems/versions.d.ts.map +1 -1
- package/resources/systems/versions.mjs.map +1 -1
- package/resources/systems.d.mts.map +1 -1
- package/resources/systems.d.ts.map +1 -1
- package/resources/systems.mjs.map +1 -1
- package/resources/testcases.d.mts.map +1 -1
- package/resources/testcases.d.ts.map +1 -1
- package/resources/testcases.mjs.map +1 -1
- package/resources/testsets.d.mts.map +1 -1
- package/resources/testsets.d.ts.map +1 -1
- package/resources/testsets.mjs.map +1 -1
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/client.ts +30 -13
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/types.ts +6 -8
- package/src/internal/utils/env.ts +2 -2
- package/src/internal/utils/log.ts +2 -0
- package/src/internal/utils/query.ts +2 -18
- package/src/resources/index.ts +1 -1
- package/src/resources/records/annotations.ts +72 -0
- package/src/resources/records/index.ts +20 -0
- package/src/resources/records/records.ts +201 -0
- package/src/resources/records/tags.ts +122 -0
- package/src/resources/records.ts +1 -161
- package/src/version.ts +1 -1
- package/uploads.d.mts +1 -0
- package/uploads.d.mts.map +1 -1
- package/uploads.d.ts +1 -0
- package/uploads.d.ts.map +1 -1
- package/uploads.mjs +1 -0
- package/uploads.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;OASG;IACH,GAAG,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIjF;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;CAGzG;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAEnC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,aAAa,IAAI,aAAa,EAAE,KAAK,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CACjG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.mjs","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"AAAA,sFAAsF;
|
|
1
|
+
{"version":3,"file":"versions.mjs","sourceRoot":"","sources":["../../src/resources/systems/versions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;OASG;IACH,GAAG,CAAC,eAAuB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qBAAqB,eAAe,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAyB,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,YAAY,QAAQ,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systems.d.mts","sourceRoot":"","sources":["../src/resources/systems.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"systems.d.mts","sourceRoot":"","sources":["../src/resources/systems.ts"],"names":[],"mappings":"AAEA,oCAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systems.d.ts","sourceRoot":"","sources":["../src/resources/systems.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"systems.d.ts","sourceRoot":"","sources":["../src/resources/systems.ts"],"names":[],"mappings":"AAEA,mCAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systems.mjs","sourceRoot":"","sources":["../src/resources/systems.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
1
|
+
{"version":3,"file":"systems.mjs","sourceRoot":"","sources":["../src/resources/systems.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,oCAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testcases.d.mts","sourceRoot":"","sources":["../src/resources/testcases.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testcases.d.mts","sourceRoot":"","sources":["../src/resources/testcases.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,+BAA2B;AAClG,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;IAIrC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAItG;;;;;;;;;;OAUG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,0BAA0B,EAAE,QAAQ,CAAC;IAOpD;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAIhG;;;;;;;OAOG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAA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AAA;KAAE,CAAC;CACtC;AAED,MAAM,WAAW,kBAAmB,SAAQ,uBAAuB;CAAG;AAEtE,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testcases.d.ts","sourceRoot":"","sources":["../src/resources/testcases.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testcases.d.ts","sourceRoot":"","sources":["../src/resources/testcases.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,8BAA2B;AAClG,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;IAIrC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CA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AAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;CACzC;AAED,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,IAAI;QACnB;;WAEG;QACH,QAAQ,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;KACtC;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACtC;AAED,MAAM,WAAW,kBAAmB,SAAQ,uBAAuB;CAAG;AAEtE,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,QAAQ,IAAI,QAAQ,EACzB,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testcases.mjs","sourceRoot":"","sources":["../src/resources/testcases.ts"],"names":[],"mappings":"AAAA,sFAAsF;
|
|
1
|
+
{"version":3,"file":"testcases.mjs","sourceRoot":"","sources":["../src/resources/testcases.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAe,iBAAiB,EAAgC,+BAA2B;AA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AmB,CAAC,YAAY,CAAC;IAEhD;;OAEG;IACH,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAExC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,yBAAiB,mBAAmB,CAAC;IACnC;;;OAGG;IACH,UAAiB,YAAY;QAC3B;;WAEG;QACH,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAExB;;WAEG;QACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEtB;;WAEG;QACH,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;KACzB;CACF;AAED,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB;CAAG;AAErE,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testsets.d.ts","sourceRoot":"","sources":["../src/resources/testsets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testsets.d.ts","sourceRoot":"","sources":["../src/resources/testsets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,KAAK,uBAAuB,EAAE,8BAA2B;AAClG,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,MAAM,CAAC,SAAS,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,KAAK,CAAC,MAAM,CAAC,CAAC;KACzB;CACF;AAED,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB;CAAG;AAErE,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testsets.mjs","sourceRoot":"","sources":["../src/resources/testsets.ts"],"names":[],"mappings":"AAAA,sFAAsF;
|
|
1
|
+
{"version":3,"file":"testsets.mjs","sourceRoot":"","sources":["../src/resources/testsets.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAe,iBAAiB,EAAgC,+BAA2B;AAElG,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,SAAS,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CACJ,SAAiB,EACjB,OAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,aAAa,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,SAAiB,EACjB,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA,aAAa,SAAS,WAAW,EAAE,CAAA,iBAA0B,CAAA,EAAE;YAChG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,SAAiB,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,SAAiB,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;CACF"}
|
package/resources.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.mts","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"resources.d.mts","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":"AAAA,sCAAkC"}
|
package/resources.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":"AAAA,qCAAkC"}
|
package/resources.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.mjs","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"resources.mjs","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":"AAAA,sCAAkC"}
|
package/src/client.ts
CHANGED
|
@@ -35,15 +35,6 @@ import {
|
|
|
35
35
|
Projects,
|
|
36
36
|
ProjectsPaginatedResponse,
|
|
37
37
|
} from './resources/projects';
|
|
38
|
-
import {
|
|
39
|
-
Record,
|
|
40
|
-
RecordCreateParams,
|
|
41
|
-
RecordDeleteResponse,
|
|
42
|
-
RecordListParams,
|
|
43
|
-
RecordListResponse,
|
|
44
|
-
RecordListResponsesPaginatedResponse,
|
|
45
|
-
Records,
|
|
46
|
-
} from './resources/records';
|
|
47
38
|
import { Run, RunCreateParams, RunListParams, Runs, RunsPaginatedResponse } from './resources/runs';
|
|
48
39
|
import { Score, ScoreUpsertParams, Scores } from './resources/scores';
|
|
49
40
|
import {
|
|
@@ -66,6 +57,15 @@ import {
|
|
|
66
57
|
Testsets,
|
|
67
58
|
TestsetsPaginatedResponse,
|
|
68
59
|
} from './resources/testsets';
|
|
60
|
+
import {
|
|
61
|
+
Record,
|
|
62
|
+
RecordCreateParams,
|
|
63
|
+
RecordDeleteResponse,
|
|
64
|
+
RecordListParams,
|
|
65
|
+
RecordListResponse,
|
|
66
|
+
RecordListResponsesPaginatedResponse,
|
|
67
|
+
Records,
|
|
68
|
+
} from './resources/records/records';
|
|
69
69
|
import {
|
|
70
70
|
System,
|
|
71
71
|
SystemDeleteResponse,
|
|
@@ -264,6 +264,18 @@ export class Scorecard {
|
|
|
264
264
|
this.fetch = options.fetch ?? Shims.getDefaultFetch();
|
|
265
265
|
this.#encoder = Opts.FallbackEncoder;
|
|
266
266
|
|
|
267
|
+
const customHeadersEnv = readEnv('SCORECARD_CUSTOM_HEADERS');
|
|
268
|
+
if (customHeadersEnv) {
|
|
269
|
+
const parsed: BuiltinRecord<string, string> = {};
|
|
270
|
+
for (const line of customHeadersEnv.split('\n')) {
|
|
271
|
+
const colon = line.indexOf(':');
|
|
272
|
+
if (colon >= 0) {
|
|
273
|
+
parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
|
|
277
|
+
}
|
|
278
|
+
|
|
267
279
|
this._options = options;
|
|
268
280
|
|
|
269
281
|
this.apiKey = apiKey;
|
|
@@ -308,9 +320,6 @@ export class Scorecard {
|
|
|
308
320
|
return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
|
|
309
321
|
}
|
|
310
322
|
|
|
311
|
-
/**
|
|
312
|
-
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
313
|
-
*/
|
|
314
323
|
protected stringifyQuery(query: object | BuiltinRecord<string, unknown>): string {
|
|
315
324
|
return stringifyQuery(query);
|
|
316
325
|
}
|
|
@@ -775,11 +784,19 @@ export class Scorecard {
|
|
|
775
784
|
return () => controller.abort();
|
|
776
785
|
}
|
|
777
786
|
|
|
778
|
-
private buildBody({ options
|
|
787
|
+
private buildBody({ options }: { options: FinalRequestOptions }): {
|
|
779
788
|
bodyHeaders: HeadersLike;
|
|
780
789
|
body: BodyInit | undefined;
|
|
781
790
|
} {
|
|
791
|
+
const { body, headers: rawHeaders } = options;
|
|
782
792
|
if (!body) {
|
|
793
|
+
// A resource method always passes a `body` key when its operation defines a
|
|
794
|
+
// request body, even if the caller omitted an optional body param. Keep the
|
|
795
|
+
// content-type for those, and only elide it for operations with no body at
|
|
796
|
+
// all (e.g. GET/DELETE).
|
|
797
|
+
if (body == null && 'body' in options) {
|
|
798
|
+
return this.#encoder({ body, headers: buildHeaders([rawHeaders]) });
|
|
799
|
+
}
|
|
783
800
|
return { bodyHeaders: undefined, body: undefined };
|
|
784
801
|
}
|
|
785
802
|
const headers = buildHeaders([rawHeaders]);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
10
|
+
|
|
11
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
12
|
+
|
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Format } from './types';
|
|
2
|
+
|
|
3
|
+
export const default_format: Format = 'RFC3986';
|
|
4
|
+
export const default_formatter = (v: PropertyKey) => String(v);
|
|
5
|
+
export const formatters: Record<Format, (str: PropertyKey) => string> = {
|
|
6
|
+
RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'),
|
|
7
|
+
RFC3986: default_formatter,
|
|
8
|
+
};
|
|
9
|
+
export const RFC1738 = 'RFC1738';
|
|
10
|
+
export const RFC3986 = 'RFC3986';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default_format, formatters, RFC1738, RFC3986 } from './formats';
|
|
2
|
+
|
|
3
|
+
const formats = {
|
|
4
|
+
formatters,
|
|
5
|
+
RFC1738,
|
|
6
|
+
RFC3986,
|
|
7
|
+
default: default_format,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { stringify } from './stringify';
|
|
11
|
+
export { formats };
|
|
12
|
+
|
|
13
|
+
export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types';
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { encode, is_buffer, maybe_map, has } from './utils';
|
|
2
|
+
import { default_format, default_formatter, formatters } from './formats';
|
|
3
|
+
import type { NonNullableProperties, StringifyOptions } from './types';
|
|
4
|
+
import { isArray } from '../utils/values';
|
|
5
|
+
|
|
6
|
+
const array_prefix_generators = {
|
|
7
|
+
brackets(prefix: PropertyKey) {
|
|
8
|
+
return String(prefix) + '[]';
|
|
9
|
+
},
|
|
10
|
+
comma: 'comma',
|
|
11
|
+
indices(prefix: PropertyKey, key: string) {
|
|
12
|
+
return String(prefix) + '[' + key + ']';
|
|
13
|
+
},
|
|
14
|
+
repeat(prefix: PropertyKey) {
|
|
15
|
+
return String(prefix);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const push_to_array = function (arr: any[], value_or_array: any) {
|
|
20
|
+
Array.prototype.push.apply(arr, isArray(value_or_array) ? value_or_array : [value_or_array]);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
let toISOString;
|
|
24
|
+
|
|
25
|
+
const defaults = {
|
|
26
|
+
addQueryPrefix: false,
|
|
27
|
+
allowDots: false,
|
|
28
|
+
allowEmptyArrays: false,
|
|
29
|
+
arrayFormat: 'indices',
|
|
30
|
+
charset: 'utf-8',
|
|
31
|
+
charsetSentinel: false,
|
|
32
|
+
delimiter: '&',
|
|
33
|
+
encode: true,
|
|
34
|
+
encodeDotInKeys: false,
|
|
35
|
+
encoder: encode,
|
|
36
|
+
encodeValuesOnly: false,
|
|
37
|
+
format: default_format,
|
|
38
|
+
formatter: default_formatter,
|
|
39
|
+
/** @deprecated */
|
|
40
|
+
indices: false,
|
|
41
|
+
serializeDate(date) {
|
|
42
|
+
return (toISOString ??= Function.prototype.call.bind(Date.prototype.toISOString))(date);
|
|
43
|
+
},
|
|
44
|
+
skipNulls: false,
|
|
45
|
+
strictNullHandling: false,
|
|
46
|
+
} as NonNullableProperties<StringifyOptions & { formatter: (typeof formatters)['RFC1738'] }>;
|
|
47
|
+
|
|
48
|
+
function is_non_nullish_primitive(v: unknown): v is string | number | boolean | symbol | bigint {
|
|
49
|
+
return (
|
|
50
|
+
typeof v === 'string' ||
|
|
51
|
+
typeof v === 'number' ||
|
|
52
|
+
typeof v === 'boolean' ||
|
|
53
|
+
typeof v === 'symbol' ||
|
|
54
|
+
typeof v === 'bigint'
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const sentinel = {};
|
|
59
|
+
|
|
60
|
+
function inner_stringify(
|
|
61
|
+
object: any,
|
|
62
|
+
prefix: PropertyKey,
|
|
63
|
+
generateArrayPrefix: StringifyOptions['arrayFormat'] | ((prefix: string, key: string) => string),
|
|
64
|
+
commaRoundTrip: boolean,
|
|
65
|
+
allowEmptyArrays: boolean,
|
|
66
|
+
strictNullHandling: boolean,
|
|
67
|
+
skipNulls: boolean,
|
|
68
|
+
encodeDotInKeys: boolean,
|
|
69
|
+
encoder: StringifyOptions['encoder'],
|
|
70
|
+
filter: StringifyOptions['filter'],
|
|
71
|
+
sort: StringifyOptions['sort'],
|
|
72
|
+
allowDots: StringifyOptions['allowDots'],
|
|
73
|
+
serializeDate: StringifyOptions['serializeDate'],
|
|
74
|
+
format: StringifyOptions['format'],
|
|
75
|
+
formatter: StringifyOptions['formatter'],
|
|
76
|
+
encodeValuesOnly: boolean,
|
|
77
|
+
charset: StringifyOptions['charset'],
|
|
78
|
+
sideChannel: WeakMap<any, any>,
|
|
79
|
+
) {
|
|
80
|
+
let obj = object;
|
|
81
|
+
|
|
82
|
+
let tmp_sc = sideChannel;
|
|
83
|
+
let step = 0;
|
|
84
|
+
let find_flag = false;
|
|
85
|
+
while ((tmp_sc = tmp_sc.get(sentinel)) !== void undefined && !find_flag) {
|
|
86
|
+
// Where object last appeared in the ref tree
|
|
87
|
+
const pos = tmp_sc.get(object);
|
|
88
|
+
step += 1;
|
|
89
|
+
if (typeof pos !== 'undefined') {
|
|
90
|
+
if (pos === step) {
|
|
91
|
+
throw new RangeError('Cyclic object value');
|
|
92
|
+
} else {
|
|
93
|
+
find_flag = true; // Break while
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (typeof tmp_sc.get(sentinel) === 'undefined') {
|
|
97
|
+
step = 0;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (typeof filter === 'function') {
|
|
102
|
+
obj = filter(prefix, obj);
|
|
103
|
+
} else if (obj instanceof Date) {
|
|
104
|
+
obj = serializeDate?.(obj);
|
|
105
|
+
} else if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
|
106
|
+
obj = maybe_map(obj, function (value) {
|
|
107
|
+
if (value instanceof Date) {
|
|
108
|
+
return serializeDate?.(value);
|
|
109
|
+
}
|
|
110
|
+
return value;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (obj === null) {
|
|
115
|
+
if (strictNullHandling) {
|
|
116
|
+
return encoder && !encodeValuesOnly ?
|
|
117
|
+
// @ts-expect-error
|
|
118
|
+
encoder(prefix, defaults.encoder, charset, 'key', format)
|
|
119
|
+
: prefix;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
obj = '';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (is_non_nullish_primitive(obj) || is_buffer(obj)) {
|
|
126
|
+
if (encoder) {
|
|
127
|
+
const key_value =
|
|
128
|
+
encodeValuesOnly ? prefix
|
|
129
|
+
// @ts-expect-error
|
|
130
|
+
: encoder(prefix, defaults.encoder, charset, 'key', format);
|
|
131
|
+
return [
|
|
132
|
+
formatter?.(key_value) +
|
|
133
|
+
'=' +
|
|
134
|
+
// @ts-expect-error
|
|
135
|
+
formatter?.(encoder(obj, defaults.encoder, charset, 'value', format)),
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
return [formatter?.(prefix) + '=' + formatter?.(String(obj))];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const values: string[] = [];
|
|
142
|
+
|
|
143
|
+
if (typeof obj === 'undefined') {
|
|
144
|
+
return values;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
let obj_keys;
|
|
148
|
+
if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
|
149
|
+
// we need to join elements in
|
|
150
|
+
if (encodeValuesOnly && encoder) {
|
|
151
|
+
// @ts-expect-error values only
|
|
152
|
+
obj = maybe_map(obj, encoder);
|
|
153
|
+
}
|
|
154
|
+
obj_keys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
|
|
155
|
+
} else if (isArray(filter)) {
|
|
156
|
+
obj_keys = filter;
|
|
157
|
+
} else {
|
|
158
|
+
const keys = Object.keys(obj);
|
|
159
|
+
obj_keys = sort ? keys.sort(sort) : keys;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
|
|
163
|
+
|
|
164
|
+
const adjusted_prefix =
|
|
165
|
+
commaRoundTrip && isArray(obj) && obj.length === 1 ? encoded_prefix + '[]' : encoded_prefix;
|
|
166
|
+
|
|
167
|
+
if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
|
|
168
|
+
return adjusted_prefix + '[]';
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
for (let j = 0; j < obj_keys.length; ++j) {
|
|
172
|
+
const key = obj_keys[j];
|
|
173
|
+
const value =
|
|
174
|
+
// @ts-ignore
|
|
175
|
+
typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key as any];
|
|
176
|
+
|
|
177
|
+
if (skipNulls && value === null) {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// @ts-ignore
|
|
182
|
+
const encoded_key = allowDots && encodeDotInKeys ? (key as any).replace(/\./g, '%2E') : key;
|
|
183
|
+
const key_prefix =
|
|
184
|
+
isArray(obj) ?
|
|
185
|
+
typeof generateArrayPrefix === 'function' ?
|
|
186
|
+
generateArrayPrefix(adjusted_prefix, encoded_key)
|
|
187
|
+
: adjusted_prefix
|
|
188
|
+
: adjusted_prefix + (allowDots ? '.' + encoded_key : '[' + encoded_key + ']');
|
|
189
|
+
|
|
190
|
+
sideChannel.set(object, step);
|
|
191
|
+
const valueSideChannel = new WeakMap();
|
|
192
|
+
valueSideChannel.set(sentinel, sideChannel);
|
|
193
|
+
push_to_array(
|
|
194
|
+
values,
|
|
195
|
+
inner_stringify(
|
|
196
|
+
value,
|
|
197
|
+
key_prefix,
|
|
198
|
+
generateArrayPrefix,
|
|
199
|
+
commaRoundTrip,
|
|
200
|
+
allowEmptyArrays,
|
|
201
|
+
strictNullHandling,
|
|
202
|
+
skipNulls,
|
|
203
|
+
encodeDotInKeys,
|
|
204
|
+
// @ts-ignore
|
|
205
|
+
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
|
|
206
|
+
filter,
|
|
207
|
+
sort,
|
|
208
|
+
allowDots,
|
|
209
|
+
serializeDate,
|
|
210
|
+
format,
|
|
211
|
+
formatter,
|
|
212
|
+
encodeValuesOnly,
|
|
213
|
+
charset,
|
|
214
|
+
valueSideChannel,
|
|
215
|
+
),
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return values;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function normalize_stringify_options(
|
|
223
|
+
opts: StringifyOptions = defaults,
|
|
224
|
+
): NonNullableProperties<Omit<StringifyOptions, 'indices'>> & { indices?: boolean } {
|
|
225
|
+
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
|
|
226
|
+
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
|
|
230
|
+
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
234
|
+
throw new TypeError('Encoder has to be a function.');
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const charset = opts.charset || defaults.charset;
|
|
238
|
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
239
|
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
let format = default_format;
|
|
243
|
+
if (typeof opts.format !== 'undefined') {
|
|
244
|
+
if (!has(formatters, opts.format)) {
|
|
245
|
+
throw new TypeError('Unknown format option provided.');
|
|
246
|
+
}
|
|
247
|
+
format = opts.format;
|
|
248
|
+
}
|
|
249
|
+
const formatter = formatters[format];
|
|
250
|
+
|
|
251
|
+
let filter = defaults.filter;
|
|
252
|
+
if (typeof opts.filter === 'function' || isArray(opts.filter)) {
|
|
253
|
+
filter = opts.filter;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
let arrayFormat: StringifyOptions['arrayFormat'];
|
|
257
|
+
if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators) {
|
|
258
|
+
arrayFormat = opts.arrayFormat;
|
|
259
|
+
} else if ('indices' in opts) {
|
|
260
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
261
|
+
} else {
|
|
262
|
+
arrayFormat = defaults.arrayFormat;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
266
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const allowDots =
|
|
270
|
+
typeof opts.allowDots === 'undefined' ?
|
|
271
|
+
!!opts.encodeDotInKeys === true ?
|
|
272
|
+
true
|
|
273
|
+
: defaults.allowDots
|
|
274
|
+
: !!opts.allowDots;
|
|
275
|
+
|
|
276
|
+
return {
|
|
277
|
+
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
|
278
|
+
// @ts-ignore
|
|
279
|
+
allowDots: allowDots,
|
|
280
|
+
allowEmptyArrays:
|
|
281
|
+
typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
282
|
+
arrayFormat: arrayFormat,
|
|
283
|
+
charset: charset,
|
|
284
|
+
charsetSentinel:
|
|
285
|
+
typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
286
|
+
commaRoundTrip: !!opts.commaRoundTrip,
|
|
287
|
+
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
|
288
|
+
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
|
289
|
+
encodeDotInKeys:
|
|
290
|
+
typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
|
|
291
|
+
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
|
292
|
+
encodeValuesOnly:
|
|
293
|
+
typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
|
294
|
+
filter: filter,
|
|
295
|
+
format: format,
|
|
296
|
+
formatter: formatter,
|
|
297
|
+
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
|
|
298
|
+
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
|
|
299
|
+
// @ts-ignore
|
|
300
|
+
sort: typeof opts.sort === 'function' ? opts.sort : null,
|
|
301
|
+
strictNullHandling:
|
|
302
|
+
typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export function stringify(object: any, opts: StringifyOptions = {}) {
|
|
307
|
+
let obj = object;
|
|
308
|
+
const options = normalize_stringify_options(opts);
|
|
309
|
+
|
|
310
|
+
let obj_keys: PropertyKey[] | undefined;
|
|
311
|
+
let filter;
|
|
312
|
+
|
|
313
|
+
if (typeof options.filter === 'function') {
|
|
314
|
+
filter = options.filter;
|
|
315
|
+
obj = filter('', obj);
|
|
316
|
+
} else if (isArray(options.filter)) {
|
|
317
|
+
filter = options.filter;
|
|
318
|
+
obj_keys = filter;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const keys: string[] = [];
|
|
322
|
+
|
|
323
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
324
|
+
return '';
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const generateArrayPrefix = array_prefix_generators[options.arrayFormat];
|
|
328
|
+
const commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
|
|
329
|
+
|
|
330
|
+
if (!obj_keys) {
|
|
331
|
+
obj_keys = Object.keys(obj);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (options.sort) {
|
|
335
|
+
obj_keys.sort(options.sort);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const sideChannel = new WeakMap();
|
|
339
|
+
for (let i = 0; i < obj_keys.length; ++i) {
|
|
340
|
+
const key = obj_keys[i]!;
|
|
341
|
+
|
|
342
|
+
if (options.skipNulls && obj[key] === null) {
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
push_to_array(
|
|
346
|
+
keys,
|
|
347
|
+
inner_stringify(
|
|
348
|
+
obj[key],
|
|
349
|
+
key,
|
|
350
|
+
// @ts-expect-error
|
|
351
|
+
generateArrayPrefix,
|
|
352
|
+
commaRoundTrip,
|
|
353
|
+
options.allowEmptyArrays,
|
|
354
|
+
options.strictNullHandling,
|
|
355
|
+
options.skipNulls,
|
|
356
|
+
options.encodeDotInKeys,
|
|
357
|
+
options.encode ? options.encoder : null,
|
|
358
|
+
options.filter,
|
|
359
|
+
options.sort,
|
|
360
|
+
options.allowDots,
|
|
361
|
+
options.serializeDate,
|
|
362
|
+
options.format,
|
|
363
|
+
options.formatter,
|
|
364
|
+
options.encodeValuesOnly,
|
|
365
|
+
options.charset,
|
|
366
|
+
sideChannel,
|
|
367
|
+
),
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
const joined = keys.join(options.delimiter);
|
|
372
|
+
let prefix = options.addQueryPrefix === true ? '?' : '';
|
|
373
|
+
|
|
374
|
+
if (options.charsetSentinel) {
|
|
375
|
+
if (options.charset === 'iso-8859-1') {
|
|
376
|
+
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
|
377
|
+
prefix += 'utf8=%26%2310003%3B&';
|
|
378
|
+
} else {
|
|
379
|
+
// encodeURIComponent('✓')
|
|
380
|
+
prefix += 'utf8=%E2%9C%93&';
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
return joined.length > 0 ? prefix + joined : '';
|
|
385
|
+
}
|