bem-ai-sdk 0.0.4
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 +28 -0
- package/LICENSE +201 -0
- package/README.md +399 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +260 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +260 -0
- package/client.d.ts.map +1 -0
- package/client.js +538 -0
- package/client.js.map +1 -0
- package/client.mjs +534 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +135 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +135 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +305 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +294 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +7 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -0
- package/index.js +32 -0
- package/index.js.map +1 -0
- package/index.mjs +8 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- 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 +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +86 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +80 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +8 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +8 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +12 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +9 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +153 -0
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/calls.d.mts +216 -0
- package/resources/calls.d.mts.map +1 -0
- package/resources/calls.d.ts +216 -0
- package/resources/calls.d.ts.map +1 -0
- package/resources/calls.js +64 -0
- package/resources/calls.js.map +1 -0
- package/resources/calls.mjs +60 -0
- package/resources/calls.mjs.map +1 -0
- package/resources/errors.d.mts +150 -0
- package/resources/errors.d.mts.map +1 -0
- package/resources/errors.d.ts +150 -0
- package/resources/errors.d.ts.map +1 -0
- package/resources/errors.js +47 -0
- package/resources/errors.js.map +1 -0
- package/resources/errors.mjs +43 -0
- package/resources/errors.mjs.map +1 -0
- package/resources/functions/copy.d.mts +81 -0
- package/resources/functions/copy.d.mts.map +1 -0
- package/resources/functions/copy.d.ts +81 -0
- package/resources/functions/copy.d.ts.map +1 -0
- package/resources/functions/copy.js +28 -0
- package/resources/functions/copy.js.map +1 -0
- package/resources/functions/copy.mjs +24 -0
- package/resources/functions/copy.mjs.map +1 -0
- package/resources/functions/functions.d.mts +1469 -0
- package/resources/functions/functions.d.mts.map +1 -0
- package/resources/functions/functions.d.ts +1469 -0
- package/resources/functions/functions.d.ts.map +1 -0
- package/resources/functions/functions.js +70 -0
- package/resources/functions/functions.js.map +1 -0
- package/resources/functions/functions.mjs +65 -0
- package/resources/functions/functions.mjs.map +1 -0
- package/resources/functions/index.d.mts +4 -0
- package/resources/functions/index.d.mts.map +1 -0
- package/resources/functions/index.d.ts +4 -0
- package/resources/functions/index.d.ts.map +1 -0
- package/resources/functions/index.js +11 -0
- package/resources/functions/index.js.map +1 -0
- package/resources/functions/index.mjs +5 -0
- package/resources/functions/index.mjs.map +1 -0
- package/resources/functions/versions.d.mts +419 -0
- package/resources/functions/versions.d.mts.map +1 -0
- package/resources/functions/versions.d.ts +419 -0
- package/resources/functions/versions.d.ts.map +1 -0
- package/resources/functions/versions.js +36 -0
- package/resources/functions/versions.js.map +1 -0
- package/resources/functions/versions.mjs +32 -0
- package/resources/functions/versions.mjs.map +1 -0
- package/resources/functions.d.mts +2 -0
- package/resources/functions.d.mts.map +1 -0
- package/resources/functions.d.ts +2 -0
- package/resources/functions.d.ts.map +1 -0
- package/resources/functions.js +6 -0
- package/resources/functions.js.map +1 -0
- package/resources/functions.mjs +3 -0
- package/resources/functions.mjs.map +1 -0
- package/resources/index.d.mts +6 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +6 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +15 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +7 -0
- package/resources/index.mjs.map +1 -0
- package/resources/outputs.d.mts +737 -0
- package/resources/outputs.d.mts.map +1 -0
- package/resources/outputs.d.ts +737 -0
- package/resources/outputs.d.ts.map +1 -0
- package/resources/outputs.js +54 -0
- package/resources/outputs.js.map +1 -0
- package/resources/outputs.mjs +50 -0
- package/resources/outputs.mjs.map +1 -0
- package/resources/workflows/index.d.mts +3 -0
- package/resources/workflows/index.d.mts.map +1 -0
- package/resources/workflows/index.d.ts +3 -0
- package/resources/workflows/index.d.ts.map +1 -0
- package/resources/workflows/index.js +9 -0
- package/resources/workflows/index.js.map +1 -0
- package/resources/workflows/index.mjs +4 -0
- package/resources/workflows/index.mjs.map +1 -0
- package/resources/workflows/versions.d.mts +37 -0
- package/resources/workflows/versions.d.mts.map +1 -0
- package/resources/workflows/versions.d.ts +37 -0
- package/resources/workflows/versions.d.ts.map +1 -0
- package/resources/workflows/versions.js +27 -0
- package/resources/workflows/versions.js.map +1 -0
- package/resources/workflows/versions.mjs +23 -0
- package/resources/workflows/versions.mjs.map +1 -0
- package/resources/workflows/workflows.d.mts +366 -0
- package/resources/workflows/workflows.d.mts.map +1 -0
- package/resources/workflows/workflows.d.ts +366 -0
- package/resources/workflows/workflows.d.ts.map +1 -0
- package/resources/workflows/workflows.js +88 -0
- package/resources/workflows/workflows.js.map +1 -0
- package/resources/workflows/workflows.mjs +83 -0
- package/resources/workflows/workflows.mjs.map +1 -0
- package/resources/workflows.d.mts +2 -0
- package/resources/workflows.d.mts.map +1 -0
- package/resources/workflows.d.ts +2 -0
- package/resources/workflows.d.ts.map +1 -0
- package/resources/workflows.js +6 -0
- package/resources/workflows.js.map +1 -0
- package/resources/workflows.mjs +3 -0
- package/resources/workflows.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +970 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +89 -0
- package/src/core/error.ts +130 -0
- package/src/core/pagination.ts +512 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +23 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +56 -0
- 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/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +127 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +9 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +2 -0
- package/src/resource.ts +2 -0
- package/src/resources/calls.ts +264 -0
- package/src/resources/errors.ts +199 -0
- package/src/resources/functions/copy.ts +96 -0
- package/src/resources/functions/functions.ts +1892 -0
- package/src/resources/functions/index.ts +30 -0
- package/src/resources/functions/versions.ts +533 -0
- package/src/resources/functions.ts +3 -0
- package/src/resources/index.ts +56 -0
- package/src/resources/outputs.ts +987 -0
- package/src/resources/workflows/index.ts +25 -0
- package/src/resources/workflows/versions.ts +68 -0
- package/src/resources/workflows/workflows.ts +505 -0
- package/src/resources/workflows.ts +3 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { BemError } from '../../core/error';
|
|
4
|
+
|
|
5
|
+
// https://url.spec.whatwg.org/#url-scheme-string
|
|
6
|
+
const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
7
|
+
|
|
8
|
+
export const isAbsoluteURL = (url: string): boolean => {
|
|
9
|
+
return startsWithSchemeRegexp.test(url);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export let isArray = (val: unknown): val is unknown[] => ((isArray = Array.isArray), isArray(val));
|
|
13
|
+
export let isReadonlyArray = isArray as (val: unknown) => val is readonly unknown[];
|
|
14
|
+
|
|
15
|
+
/** Returns an object if the given value isn't an object, otherwise returns as-is */
|
|
16
|
+
export function maybeObj(x: unknown): object {
|
|
17
|
+
if (typeof x !== 'object') {
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return x ?? {};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// https://stackoverflow.com/a/34491287
|
|
25
|
+
export function isEmptyObj(obj: Object | null | undefined): boolean {
|
|
26
|
+
if (!obj) return true;
|
|
27
|
+
for (const _k in obj) return false;
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// https://eslint.org/docs/latest/rules/no-prototype-builtins
|
|
32
|
+
export function hasOwn<T extends object = object>(obj: T, key: PropertyKey): key is keyof T {
|
|
33
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function isObj(obj: unknown): obj is Record<string, unknown> {
|
|
37
|
+
return obj != null && typeof obj === 'object' && !Array.isArray(obj);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const ensurePresent = <T>(value: T | null | undefined): T => {
|
|
41
|
+
if (value == null) {
|
|
42
|
+
throw new BemError(`Expected a value to be given but received ${value} instead.`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return value;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const validatePositiveInteger = (name: string, n: unknown): number => {
|
|
49
|
+
if (typeof n !== 'number' || !Number.isInteger(n)) {
|
|
50
|
+
throw new BemError(`${name} must be an integer`);
|
|
51
|
+
}
|
|
52
|
+
if (n < 0) {
|
|
53
|
+
throw new BemError(`${name} must be a positive integer`);
|
|
54
|
+
}
|
|
55
|
+
return n;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const coerceInteger = (value: unknown): number => {
|
|
59
|
+
if (typeof value === 'number') return Math.round(value);
|
|
60
|
+
if (typeof value === 'string') return parseInt(value, 10);
|
|
61
|
+
|
|
62
|
+
throw new BemError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const coerceFloat = (value: unknown): number => {
|
|
66
|
+
if (typeof value === 'number') return value;
|
|
67
|
+
if (typeof value === 'string') return parseFloat(value);
|
|
68
|
+
|
|
69
|
+
throw new BemError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const coerceBoolean = (value: unknown): boolean => {
|
|
73
|
+
if (typeof value === 'boolean') return value;
|
|
74
|
+
if (typeof value === 'string') return value === 'true';
|
|
75
|
+
return Boolean(value);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const maybeCoerceInteger = (value: unknown): number | undefined => {
|
|
79
|
+
if (value == null) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
return coerceInteger(value);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const maybeCoerceFloat = (value: unknown): number | undefined => {
|
|
86
|
+
if (value == null) {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
return coerceFloat(value);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
|
|
93
|
+
if (value == null) {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
return coerceBoolean(value);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const safeJSON = (text: string) => {
|
|
100
|
+
try {
|
|
101
|
+
return JSON.parse(text);
|
|
102
|
+
} catch (err) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export * from './utils/values';
|
|
4
|
+
export * from './utils/base64';
|
|
5
|
+
export * from './utils/env';
|
|
6
|
+
export * from './utils/log';
|
|
7
|
+
export * from './utils/uuid';
|
|
8
|
+
export * from './utils/sleep';
|
|
9
|
+
export * from './utils/query';
|
package/src/lib/.keep
ADDED
package/src/resource.ts
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as ErrorsAPI from './errors';
|
|
5
|
+
import * as OutputsAPI from './outputs';
|
|
6
|
+
import { APIPromise } from '../core/api-promise';
|
|
7
|
+
import { CallsPage, type CallsPageParams, PagePromise } from '../core/pagination';
|
|
8
|
+
import { RequestOptions } from '../internal/request-options';
|
|
9
|
+
import { path } from '../internal/utils/path';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The Calls API provides a unified interface for invoking both **Workflows** and **Functions**.
|
|
13
|
+
*
|
|
14
|
+
* Use this API when you want to:
|
|
15
|
+
* - Execute a complete workflow that chains multiple functions together
|
|
16
|
+
* - Call a single function directly without defining a workflow
|
|
17
|
+
* - Submit batch requests with multiple inputs in a single API call
|
|
18
|
+
* - Track execution status using call reference IDs
|
|
19
|
+
*
|
|
20
|
+
* **Key Difference**: Calls vs Function Calls
|
|
21
|
+
* - **Calls API** (`/v3/calls`): High-level API for invoking workflows or functions by name/ID. Supports batch processing and workflow orchestration.
|
|
22
|
+
* - **Function Calls API** (`/v3/functions/{functionName}/call`): Direct function invocation with function-type-specific arguments. Better for granular control over individual function calls.
|
|
23
|
+
*/
|
|
24
|
+
export class Calls extends APIResource {
|
|
25
|
+
/**
|
|
26
|
+
* **Retrieve a workflow call by ID.**
|
|
27
|
+
*
|
|
28
|
+
* Returns the full call object including status, workflow details, terminal
|
|
29
|
+
* outputs, and terminal errors. `outputs` and `errors` are both populated once the
|
|
30
|
+
* call finishes — they are not mutually exclusive (a partially-completed workflow
|
|
31
|
+
* may have both).
|
|
32
|
+
*
|
|
33
|
+
* ## Status
|
|
34
|
+
*
|
|
35
|
+
* | Status | Description |
|
|
36
|
+
* | ----------- | ----------------------------------------------------------- |
|
|
37
|
+
* | `pending` | Queued, not yet started |
|
|
38
|
+
* | `running` | Currently executing |
|
|
39
|
+
* | `completed` | All enclosed function calls finished without errors |
|
|
40
|
+
* | `failed` | One or more enclosed function calls produced an error event |
|
|
41
|
+
*
|
|
42
|
+
* Poll this endpoint or configure a webhook subscription to detect completion.
|
|
43
|
+
*/
|
|
44
|
+
retrieve(callID: string, options?: RequestOptions): APIPromise<CallGetResponse> {
|
|
45
|
+
return this._client.get(path`/v3/calls/${callID}`, options);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* **List workflow calls with filtering and pagination.**
|
|
50
|
+
*
|
|
51
|
+
* Returns calls created via `POST /v3/workflows/{workflowName}/call`.
|
|
52
|
+
*
|
|
53
|
+
* ## Filtering
|
|
54
|
+
*
|
|
55
|
+
* - `callIDs`: Specific call identifiers
|
|
56
|
+
* - `referenceIDs`: Your custom reference IDs
|
|
57
|
+
* - `workflowIDs` / `workflowNames`: Filter by workflow
|
|
58
|
+
*
|
|
59
|
+
* ## Pagination
|
|
60
|
+
*
|
|
61
|
+
* Use `startingAfter` and `endingBefore` cursors with a default limit of 50.
|
|
62
|
+
*/
|
|
63
|
+
list(
|
|
64
|
+
query: CallListParams | null | undefined = {},
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): PagePromise<CallsCallsPage, Call> {
|
|
67
|
+
return this._client.getAPIList('/v3/calls', CallsPage<Call>, { query, ...options });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type CallsCallsPage = CallsPage<Call>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* A workflow call returned by the V3 API.
|
|
75
|
+
*
|
|
76
|
+
* Compared to the V2 `Call` model:
|
|
77
|
+
*
|
|
78
|
+
* - Terminal outputs are split into `outputs` (non-error events) and `errors`
|
|
79
|
+
* (error events)
|
|
80
|
+
* - `callType` and function-scoped fields are removed — V3 calls are always
|
|
81
|
+
* workflow calls
|
|
82
|
+
* - The deprecated `functionCalls` field is removed (use
|
|
83
|
+
* `GET /v3/calls/{callID}/trace`)
|
|
84
|
+
* - `url` and `traceUrl` hint fields are included for resource discovery
|
|
85
|
+
*/
|
|
86
|
+
export interface Call {
|
|
87
|
+
/**
|
|
88
|
+
* Unique identifier of the call.
|
|
89
|
+
*/
|
|
90
|
+
callID: string;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The date and time the call was created.
|
|
94
|
+
*/
|
|
95
|
+
createdAt: string;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Terminal error events of this call. Workflow calls are not atomic — `errors` and
|
|
99
|
+
* `outputs` may both be non-empty if some enclosed function calls succeeded and
|
|
100
|
+
* others failed.
|
|
101
|
+
*
|
|
102
|
+
* Retrieve individual errors via `GET /v3/errors/{eventID}`.
|
|
103
|
+
*/
|
|
104
|
+
errors: Array<ErrorsAPI.ErrorEvent>;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Terminal non-error outputs of this call: primary events (non-split-collection)
|
|
108
|
+
* that did not trigger any downstream function calls. Workflow calls are not
|
|
109
|
+
* atomic — `outputs` and `errors` may both be non-empty if some enclosed function
|
|
110
|
+
* calls succeeded and others failed.
|
|
111
|
+
*
|
|
112
|
+
* Each element is a polymorphic event object; inspect `eventType` to determine the
|
|
113
|
+
* type. Retrieve individual outputs via `GET /v3/outputs/{eventID}`.
|
|
114
|
+
*/
|
|
115
|
+
outputs: Array<OutputsAPI.Event>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Hint URL for the full execution trace: `GET /v3/calls/{callID}/trace`.
|
|
119
|
+
*/
|
|
120
|
+
traceUrl: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Hint URL for retrieving this call: `GET /v3/calls/{callID}`.
|
|
124
|
+
*/
|
|
125
|
+
url: string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Your reference ID for this call, propagated from the original request.
|
|
129
|
+
*/
|
|
130
|
+
callReferenceID?: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The date and time the call finished. Only set once status is `completed` or
|
|
134
|
+
* `failed`.
|
|
135
|
+
*/
|
|
136
|
+
finishedAt?: string;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Input to the main function call.
|
|
140
|
+
*/
|
|
141
|
+
input?: Call.Input;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Status of call.
|
|
145
|
+
*/
|
|
146
|
+
status?: 'pending' | 'running' | 'completed' | 'failed';
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Unique identifier of the workflow.
|
|
150
|
+
*/
|
|
151
|
+
workflowID?: string;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Name of the workflow.
|
|
155
|
+
*/
|
|
156
|
+
workflowName?: string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Version number of the workflow.
|
|
160
|
+
*/
|
|
161
|
+
workflowVersionNum?: number;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export namespace Call {
|
|
165
|
+
/**
|
|
166
|
+
* Input to the main function call.
|
|
167
|
+
*/
|
|
168
|
+
export interface Input {
|
|
169
|
+
batchFiles?: Input.BatchFiles;
|
|
170
|
+
|
|
171
|
+
singleFile?: Input.SingleFile;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export namespace Input {
|
|
175
|
+
export interface BatchFiles {
|
|
176
|
+
inputs?: Array<BatchFiles.Input>;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export namespace BatchFiles {
|
|
180
|
+
export interface Input {
|
|
181
|
+
/**
|
|
182
|
+
* Input type of the file
|
|
183
|
+
*/
|
|
184
|
+
inputType?: string;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Item reference ID
|
|
188
|
+
*/
|
|
189
|
+
itemReferenceID?: string;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Presigned S3 URL for the file
|
|
193
|
+
*/
|
|
194
|
+
s3URL?: string;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface SingleFile {
|
|
199
|
+
/**
|
|
200
|
+
* Input type of the file
|
|
201
|
+
*/
|
|
202
|
+
inputType?: string;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Presigned S3 URL for the file
|
|
206
|
+
*/
|
|
207
|
+
s3URL?: string;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface CallGetResponse {
|
|
213
|
+
/**
|
|
214
|
+
* A workflow call returned by the V3 API.
|
|
215
|
+
*
|
|
216
|
+
* Compared to the V2 `Call` model:
|
|
217
|
+
*
|
|
218
|
+
* - Terminal outputs are split into `outputs` (non-error events) and `errors`
|
|
219
|
+
* (error events)
|
|
220
|
+
* - `callType` and function-scoped fields are removed — V3 calls are always
|
|
221
|
+
* workflow calls
|
|
222
|
+
* - The deprecated `functionCalls` field is removed (use
|
|
223
|
+
* `GET /v3/calls/{callID}/trace`)
|
|
224
|
+
* - `url` and `traceUrl` hint fields are included for resource discovery
|
|
225
|
+
*/
|
|
226
|
+
call?: Call;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Error message if the call retrieval failed, or if the call itself failed when
|
|
230
|
+
* using `wait=true`.
|
|
231
|
+
*/
|
|
232
|
+
error?: string;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export interface CallListParams extends CallsPageParams {
|
|
236
|
+
callIDs?: Array<string>;
|
|
237
|
+
|
|
238
|
+
referenceIDs?: Array<string>;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Case-insensitive substring match against `callReferenceID`.
|
|
242
|
+
*/
|
|
243
|
+
referenceIDSubstring?: string;
|
|
244
|
+
|
|
245
|
+
sortOrder?: 'asc' | 'desc';
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Filter by one or more statuses.
|
|
249
|
+
*/
|
|
250
|
+
statuses?: Array<'pending' | 'running' | 'completed' | 'failed'>;
|
|
251
|
+
|
|
252
|
+
workflowIDs?: Array<string>;
|
|
253
|
+
|
|
254
|
+
workflowNames?: Array<string>;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export declare namespace Calls {
|
|
258
|
+
export {
|
|
259
|
+
type Call as Call,
|
|
260
|
+
type CallGetResponse as CallGetResponse,
|
|
261
|
+
type CallsCallsPage as CallsCallsPage,
|
|
262
|
+
type CallListParams as CallListParams,
|
|
263
|
+
};
|
|
264
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { ErrorsPage, type ErrorsPageParams, PagePromise } from '../core/pagination';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Retrieve terminal error events from workflow calls.
|
|
11
|
+
*
|
|
12
|
+
* Errors are events produced by function steps that failed during processing. A single workflow
|
|
13
|
+
* call may produce multiple error events if several steps fail independently.
|
|
14
|
+
*
|
|
15
|
+
* Errors and outputs from the same call are not mutually exclusive: a partially-completed
|
|
16
|
+
* workflow may have both.
|
|
17
|
+
*
|
|
18
|
+
* Use `GET /v3/errors` to list errors across calls, or `GET /v3/errors/{eventID}` to retrieve
|
|
19
|
+
* a specific error. To get errors scoped to a single call, filter by `callIDs`.
|
|
20
|
+
*/
|
|
21
|
+
export class Errors extends APIResource {
|
|
22
|
+
/**
|
|
23
|
+
* **Retrieve a single error event by ID.**
|
|
24
|
+
*
|
|
25
|
+
* Returns `404` if the event does not exist or if it is not an error event (use
|
|
26
|
+
* `GET /v3/outputs/{eventID}` for non-error events).
|
|
27
|
+
*/
|
|
28
|
+
retrieve(eventID: string, options?: RequestOptions): APIPromise<ErrorRetrieveResponse> {
|
|
29
|
+
return this._client.get(path`/v3/errors/${eventID}`, options);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* **List terminal error events.**
|
|
34
|
+
*
|
|
35
|
+
* Returns error events produced by failed function calls within workflow
|
|
36
|
+
* executions. Non-error output events are excluded; use `GET /v3/outputs` to
|
|
37
|
+
* retrieve those.
|
|
38
|
+
*
|
|
39
|
+
* ## Filtering
|
|
40
|
+
*
|
|
41
|
+
* Filter by call, workflow, function, or reference ID. Multiple filters are ANDed
|
|
42
|
+
* together.
|
|
43
|
+
*/
|
|
44
|
+
list(
|
|
45
|
+
query: ErrorListParams | null | undefined = {},
|
|
46
|
+
options?: RequestOptions,
|
|
47
|
+
): PagePromise<ErrorEventsErrorsPage, ErrorEvent> {
|
|
48
|
+
return this._client.getAPIList('/v3/errors', ErrorsPage<ErrorEvent>, { query, ...options });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type ErrorEventsErrorsPage = ErrorsPage<ErrorEvent>;
|
|
53
|
+
|
|
54
|
+
export interface ErrorEvent {
|
|
55
|
+
/**
|
|
56
|
+
* Unique ID generated by bem to identify the event.
|
|
57
|
+
*/
|
|
58
|
+
eventID: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Unique identifier of function that this event is associated with.
|
|
62
|
+
*/
|
|
63
|
+
functionID: string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Unique name of function that this event is associated with.
|
|
67
|
+
*/
|
|
68
|
+
functionName: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Error message.
|
|
72
|
+
*/
|
|
73
|
+
message: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The unique ID you use internally to refer to this data point, propagated from
|
|
77
|
+
* the original function input.
|
|
78
|
+
*/
|
|
79
|
+
referenceID: string;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Unique identifier of workflow call that this event is associated with.
|
|
83
|
+
*/
|
|
84
|
+
callID?: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Timestamp indicating when the event was created.
|
|
88
|
+
*/
|
|
89
|
+
createdAt?: string;
|
|
90
|
+
|
|
91
|
+
eventType?: 'error';
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Unique identifier of function call that this event is associated with.
|
|
95
|
+
*/
|
|
96
|
+
functionCallID?: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The attempt number of the function call that created this event. 1 indexed.
|
|
100
|
+
*/
|
|
101
|
+
functionCallTryNumber?: number;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Version number of function that this event is associated with.
|
|
105
|
+
*/
|
|
106
|
+
functionVersionNum?: number;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The inbound email that triggered this event.
|
|
110
|
+
*/
|
|
111
|
+
inboundEmail?: InboundEmailEvent;
|
|
112
|
+
|
|
113
|
+
metadata?: ErrorEvent.Metadata;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Unique identifier of workflow that this event is associated with.
|
|
117
|
+
*/
|
|
118
|
+
workflowID?: string;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Name of workflow that this event is associated with.
|
|
122
|
+
*/
|
|
123
|
+
workflowName?: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Version number of workflow that this event is associated with.
|
|
127
|
+
*/
|
|
128
|
+
workflowVersionNum?: number;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export namespace ErrorEvent {
|
|
132
|
+
export interface Metadata {
|
|
133
|
+
durationFunctionToEventSeconds?: number;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface InboundEmailEvent {
|
|
138
|
+
/**
|
|
139
|
+
* The email address of the sender.
|
|
140
|
+
*/
|
|
141
|
+
from: string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The subject of the email.
|
|
145
|
+
*/
|
|
146
|
+
subject: string;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The email address of the recipient.
|
|
150
|
+
*/
|
|
151
|
+
to: string;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The email address of the original intended recipient if the email itself was
|
|
155
|
+
* forwarded.
|
|
156
|
+
*/
|
|
157
|
+
deliveredTo?: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface ErrorRetrieveResponse {
|
|
161
|
+
/**
|
|
162
|
+
* The error event.
|
|
163
|
+
*/
|
|
164
|
+
error: ErrorEvent;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface ErrorListParams extends ErrorsPageParams {
|
|
168
|
+
/**
|
|
169
|
+
* Filter to errors from specific calls.
|
|
170
|
+
*/
|
|
171
|
+
callIDs?: Array<string>;
|
|
172
|
+
|
|
173
|
+
functionIDs?: Array<string>;
|
|
174
|
+
|
|
175
|
+
functionNames?: Array<string>;
|
|
176
|
+
|
|
177
|
+
referenceIDs?: Array<string>;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Case-insensitive substring match against `referenceID`.
|
|
181
|
+
*/
|
|
182
|
+
referenceIDSubstring?: string;
|
|
183
|
+
|
|
184
|
+
sortOrder?: 'asc' | 'desc';
|
|
185
|
+
|
|
186
|
+
workflowIDs?: Array<string>;
|
|
187
|
+
|
|
188
|
+
workflowNames?: Array<string>;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export declare namespace Errors {
|
|
192
|
+
export {
|
|
193
|
+
type ErrorEvent as ErrorEvent,
|
|
194
|
+
type InboundEmailEvent as InboundEmailEvent,
|
|
195
|
+
type ErrorRetrieveResponse as ErrorRetrieveResponse,
|
|
196
|
+
type ErrorEventsErrorsPage as ErrorEventsErrorsPage,
|
|
197
|
+
type ErrorListParams as ErrorListParams,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as FunctionsAPI from './functions';
|
|
5
|
+
import { APIPromise } from '../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Functions are the core building blocks of data transformation in Bem. Each function type serves a specific purpose:
|
|
10
|
+
*
|
|
11
|
+
* - **Transform**: Extract structured JSON data from unstructured documents (PDFs, emails, images)
|
|
12
|
+
* - **Analyze**: Perform visual analysis on documents to extract layout-aware information
|
|
13
|
+
* - **Route**: Direct data to different processing paths based on conditions
|
|
14
|
+
* - **Split**: Break multi-page documents into individual pages for parallel processing
|
|
15
|
+
* - **Join**: Combine outputs from multiple function calls into a single result
|
|
16
|
+
* - **Payload Shaping**: Transform and restructure data using JMESPath expressions
|
|
17
|
+
* - **Enrich**: Enhance data with semantic search against collections
|
|
18
|
+
*
|
|
19
|
+
* Use these endpoints to create, update, list, and manage your functions.
|
|
20
|
+
*/
|
|
21
|
+
export class Copy extends APIResource {
|
|
22
|
+
/**
|
|
23
|
+
* Copy a Function
|
|
24
|
+
*/
|
|
25
|
+
create(body: CopyCreateParams, options?: RequestOptions): APIPromise<FunctionsAPI.FunctionResponse> {
|
|
26
|
+
return this._client.post('/v3/functions/copy', { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Request to copy an existing function with a new name and optional
|
|
32
|
+
* customizations.
|
|
33
|
+
*/
|
|
34
|
+
export interface FunctionCopyRequest {
|
|
35
|
+
/**
|
|
36
|
+
* Name of the function to copy from. Must be a valid existing function name.
|
|
37
|
+
*/
|
|
38
|
+
sourceFunctionName: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Name for the new copied function. Must be unique within the target environment.
|
|
42
|
+
*/
|
|
43
|
+
targetFunctionName: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Optional array of tags for the copied function. If not provided, defaults to the
|
|
47
|
+
* source function's tags.
|
|
48
|
+
*/
|
|
49
|
+
tags?: Array<string>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Optional display name for the copied function. If not provided, defaults to the
|
|
53
|
+
* source function's display name with " (Copy)" appended.
|
|
54
|
+
*/
|
|
55
|
+
targetDisplayName?: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Optional environment name to copy the function to. If not provided, the function
|
|
59
|
+
* will be copied within the same environment.
|
|
60
|
+
*/
|
|
61
|
+
targetEnvironment?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface CopyCreateParams {
|
|
65
|
+
/**
|
|
66
|
+
* Name of the function to copy from. Must be a valid existing function name.
|
|
67
|
+
*/
|
|
68
|
+
sourceFunctionName: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Name for the new copied function. Must be unique within the target environment.
|
|
72
|
+
*/
|
|
73
|
+
targetFunctionName: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Optional array of tags for the copied function. If not provided, defaults to the
|
|
77
|
+
* source function's tags.
|
|
78
|
+
*/
|
|
79
|
+
tags?: Array<string>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Optional display name for the copied function. If not provided, defaults to the
|
|
83
|
+
* source function's display name with " (Copy)" appended.
|
|
84
|
+
*/
|
|
85
|
+
targetDisplayName?: string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Optional environment name to copy the function to. If not provided, the function
|
|
89
|
+
* will be copied within the same environment.
|
|
90
|
+
*/
|
|
91
|
+
targetEnvironment?: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export declare namespace Copy {
|
|
95
|
+
export { type FunctionCopyRequest as FunctionCopyRequest, type CopyCreateParams as CopyCreateParams };
|
|
96
|
+
}
|