diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 2e6d1af6..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: CI -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - lint: - name: lint - runs-on: ubuntu-latest - - - steps: - - uses: actions/checkout@v4 - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: '18' - - - name: Install dependencies - run: | - yarn install - - - name: Check types - run: | - yarn build diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml deleted file mode 100644 index e9932b75..00000000 --- a/.github/workflows/publish-npm.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow is triggered when a GitHub release is created. -# It can also be run manually to re-publish to NPM in case it failed for some reason. -# You can run this workflow by navigating to https://www.github.com/dubinc/dub-node/actions/workflows/publish-npm.yml -name: Publish NPM -on: - workflow_dispatch: - - release: - types: [published] - -jobs: - publish: - name: publish - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Set up Node - uses: actions/setup-node@v3 - with: - node-version: '18' - - - name: Install dependencies - run: | - yarn install - - - name: Publish to NPM - run: | - bash ./bin/publish-npm - env: - NPM_TOKEN: ${{ secrets.DUB_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml deleted file mode 100644 index c88175e1..00000000 --- a/.github/workflows/release-doctor.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Release Doctor -on: - pull_request: - workflow_dispatch: - -jobs: - release_doctor: - name: release doctor - runs-on: ubuntu-latest - if: github.repository == 'dubinc/dub-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') - - steps: - - uses: actions/checkout@v3 - - - name: Check release environment - run: | - bash ./bin/check-release-environment - env: - NPM_TOKEN: ${{ secrets.DUB_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.github/workflows/sdk-generation.yml b/.github/workflows/sdk-generation.yml new file mode 100644 index 00000000..ea909a47 --- /dev/null +++ b/.github/workflows/sdk-generation.yml @@ -0,0 +1,30 @@ +name: Generate + +permissions: + checks: write + contents: write + pull-requests: write + statuses: write + +on: + workflow_dispatch: + inputs: + force: + description: Force generation of SDKs + type: boolean + default: false + schedule: + - cron: 0 0 * * * + +jobs: + generate: + uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 + with: + force: ${{ github.event.inputs.force }} + mode: pr + speakeasy_version: latest + working_directory: ./typescript + secrets: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} + # npm_token: ${{ secrets.NPM_TOKEN }} diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock new file mode 100755 index 00000000..0bdc71e0 --- /dev/null +++ b/.speakeasy/gen.lock @@ -0,0 +1,203 @@ +lockVersion: 2.0.0 +id: f28179cc-ef59-426d-9e85-60cec22fc642 +management: + docChecksum: cca62df209e2e9fe36ff456a41001da4 + docVersion: 0.0.1 + speakeasyVersion: 1.244.0 + generationVersion: 2.301.0 + releaseVersion: 0.18.3 + configChecksum: df48e024b99e6b2abb07c6eafc8d5bfd +features: + typescript: + acceptHeaders: 2.81.1 + constsAndDefaults: 0.1.5 + core: 3.7.1 + deprecations: 2.81.1 + flattening: 2.81.1 + globalSecurity: 2.82.9 + globalServerURLs: 2.82.4 + globals: 2.82.1 + hiddenGlobals: 0.1.0 + nameOverrides: 2.81.2 + responseFormat: 0.2.3 + unions: 2.85.3 +generatedFiles: + - src/sdk/links.ts + - src/sdk/qrcodes.ts + - src/sdk/analytics.ts + - src/sdk/workspaces.ts + - src/sdk/tags.ts + - src/sdk/sdk.ts + - .eslintrc.js + - .npmignore + - RUNTIMES.md + - package.json + - src/index.ts + - src/lib/base64.ts + - src/lib/config.ts + - src/lib/encodings.ts + - src/lib/http.ts + - src/lib/retries.ts + - src/lib/schemas.ts + - src/lib/sdks.ts + - src/lib/security.ts + - src/lib/url.ts + - src/sdk/index.ts + - src/models/errors/sdkerror.ts + - src/models/errors/sdkvalidationerror.ts + - src/types/blobs.ts + - src/types/index.ts + - src/types/operations.ts + - src/types/rfcdate.ts + - tsconfig.json + - src/models/components/linkschema.ts + - src/models/components/tagschema.ts + - src/models/components/workspaceschema.ts + - src/models/components/security.ts + - src/models/errors/badrequest.ts + - src/models/errors/unauthorized.ts + - src/models/errors/forbidden.ts + - src/models/errors/notfound.ts + - src/models/errors/conflict.ts + - src/models/errors/inviteexpired.ts + - src/models/errors/unprocessableentity.ts + - src/models/errors/ratelimitexceeded.ts + - src/models/errors/internalservererror.ts + - src/models/operations/getlinks.ts + - src/models/operations/createlink.ts + - src/models/operations/getlinkscount.ts + - src/models/operations/getlinkinfo.ts + - src/models/operations/editlink.ts + - src/models/operations/deletelink.ts + - src/models/operations/bulkcreatelinks.ts + - src/models/operations/getqrcode.ts + - src/models/operations/getclicksanalytics.ts + - src/models/operations/gettimeseriesanalytics.ts + - src/models/operations/getcountryanalytics.ts + - src/models/operations/getcityanalytics.ts + - src/models/operations/getdeviceanalytics.ts + - src/models/operations/getbrowseranalytics.ts + - src/models/operations/getosanalytics.ts + - src/models/operations/getrefereranalytics.ts + - src/models/operations/gettoplinks.ts + - src/models/operations/gettopurls.ts + - src/models/operations/createworkspace.ts + - src/models/operations/getworkspace.ts + - src/models/operations/gettags.ts + - src/models/operations/createtag.ts + - src/models/errors/index.ts + - src/models/components/index.ts + - src/models/operations/index.ts + - docs/models/components/linkschema.md + - docs/models/components/color.md + - docs/models/components/tagschema.md + - docs/models/components/plan.md + - docs/models/components/role.md + - docs/models/components/users.md + - docs/models/components/domains.md + - docs/models/components/workspaceschema.md + - docs/models/components/security.md + - docs/models/errors/code.md + - docs/models/errors/errort.md + - docs/models/errors/badrequest.md + - docs/models/errors/unauthorizedcode.md + - docs/models/errors/unauthorizederror.md + - docs/models/errors/unauthorized.md + - docs/models/errors/forbiddencode.md + - docs/models/errors/forbiddenerror.md + - docs/models/errors/forbidden.md + - docs/models/errors/notfoundcode.md + - docs/models/errors/notfounderror.md + - docs/models/errors/notfound.md + - docs/models/errors/conflictcode.md + - docs/models/errors/conflicterror.md + - docs/models/errors/conflict.md + - docs/models/errors/inviteexpiredcode.md + - docs/models/errors/inviteexpirederror.md + - docs/models/errors/inviteexpired.md + - docs/models/errors/unprocessableentitycode.md + - docs/models/errors/unprocessableentityerror.md + - docs/models/errors/unprocessableentity.md + - docs/models/errors/ratelimitexceededcode.md + - docs/models/errors/ratelimitexceedederror.md + - docs/models/errors/ratelimitexceeded.md + - docs/models/errors/internalservererrorcode.md + - docs/models/errors/internalservererrorerror.md + - docs/models/errors/internalservererror.md + - docs/models/operations/queryparamtagids.md + - docs/models/operations/sort.md + - docs/models/operations/getlinksrequest.md + - docs/models/operations/tagids.md + - docs/models/operations/createlinkrequestbody.md + - docs/models/operations/getlinkscountqueryparamtagids.md + - docs/models/operations/two.md + - docs/models/operations/one.md + - docs/models/operations/groupby.md + - docs/models/operations/getlinkscountrequest.md + - docs/models/operations/getlinkinforequest.md + - docs/models/operations/editlinktagids.md + - docs/models/operations/editlinkrequestbody.md + - docs/models/operations/editlinkrequest.md + - docs/models/operations/deletelinkrequest.md + - docs/models/operations/deletelinkresponsebody.md + - docs/models/operations/bulkcreatelinkstagids.md + - docs/models/operations/requestbody.md + - docs/models/operations/level.md + - docs/models/operations/getqrcoderequest.md + - docs/models/operations/interval.md + - docs/models/operations/country.md + - docs/models/operations/getclicksanalyticsrequest.md + - docs/models/operations/queryparaminterval.md + - docs/models/operations/queryparamcountry.md + - docs/models/operations/gettimeseriesanalyticsrequest.md + - docs/models/operations/responsebody.md + - docs/models/operations/getcountryanalyticsqueryparaminterval.md + - docs/models/operations/getcountryanalyticsqueryparamcountry.md + - docs/models/operations/getcountryanalyticsrequest.md + - docs/models/operations/getcountryanalyticscountry.md + - docs/models/operations/getcountryanalyticsresponsebody.md + - docs/models/operations/getcityanalyticsqueryparaminterval.md + - docs/models/operations/getcityanalyticsqueryparamcountry.md + - docs/models/operations/getcityanalyticsrequest.md + - docs/models/operations/getcityanalyticscountry.md + - docs/models/operations/getcityanalyticsresponsebody.md + - docs/models/operations/getdeviceanalyticsqueryparaminterval.md + - docs/models/operations/getdeviceanalyticsqueryparamcountry.md + - docs/models/operations/getdeviceanalyticsrequest.md + - docs/models/operations/getdeviceanalyticsresponsebody.md + - docs/models/operations/getbrowseranalyticsqueryparaminterval.md + - docs/models/operations/getbrowseranalyticsqueryparamcountry.md + - docs/models/operations/getbrowseranalyticsrequest.md + - docs/models/operations/getbrowseranalyticsresponsebody.md + - docs/models/operations/getosanalyticsqueryparaminterval.md + - docs/models/operations/getosanalyticsqueryparamcountry.md + - docs/models/operations/getosanalyticsrequest.md + - docs/models/operations/getosanalyticsresponsebody.md + - docs/models/operations/getrefereranalyticsqueryparaminterval.md + - docs/models/operations/getrefereranalyticsqueryparamcountry.md + - docs/models/operations/getrefereranalyticsrequest.md + - docs/models/operations/getrefereranalyticsresponsebody.md + - docs/models/operations/gettoplinksqueryparaminterval.md + - docs/models/operations/gettoplinksqueryparamcountry.md + - docs/models/operations/gettoplinksrequest.md + - docs/models/operations/gettoplinksresponsebody.md + - docs/models/operations/gettopurlsqueryparaminterval.md + - docs/models/operations/gettopurlsqueryparamcountry.md + - docs/models/operations/gettopurlsrequest.md + - docs/models/operations/gettopurlsresponsebody.md + - docs/models/operations/createworkspacerequestbody.md + - docs/models/operations/getworkspacerequest.md + - docs/models/operations/gettagsrequest.md + - docs/models/operations/color.md + - docs/models/operations/createtagrequestbody.md + - docs/sdks/dub/README.md + - docs/sdks/links/README.md + - docs/sdks/qrcodes/README.md + - docs/sdks/analytics/README.md + - docs/sdks/workspaces/README.md + - docs/sdks/tags/README.md + - USAGE.md + - .gitattributes + - src/hooks/hooks.ts + - src/hooks/types.ts + - src/hooks/index.ts diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml new file mode 100755 index 00000000..6144322d --- /dev/null +++ b/.speakeasy/gen.yaml @@ -0,0 +1,37 @@ +configVersion: 2.0.0 +generation: + sdkClassName: dub + maintainOpenAPIOrder: true + usageSnippets: + optionalPropertyRendering: withExample + useClassNamesForArrayFields: true + fixes: + nameResolutionDec2023: true + parameterOrderingFeb2024: true + requestResponseComponentNamesFeb2024: true + auth: + oAuth2ClientCredentialsEnabled: false +typescript: + version: 0.18.3 + additionalDependencies: + dependencies: {} + devDependencies: + vitest: 1.4.0 + peerDependencies: {} + author: Dub + clientServerStatusCodesAsErrors: true + flattenGlobalSecurity: true + imports: + option: openapi + paths: + callbacks: models/callbacks + errors: models/errors + operations: models/operations + shared: models/components + webhooks: models/webhooks + inputModelSuffix: input + maxMethodParams: 0 + outputModelSuffix: output + packageName: dub + responseFormat: flat + templateVersion: v2 diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml new file mode 100644 index 00000000..f886a690 --- /dev/null +++ b/.speakeasy/workflow.yaml @@ -0,0 +1,10 @@ +workflowVersion: 1.0.0 +sources: + my-first-source: + inputs: + - location: https://api.dub.sh +targets: + my-first-target: + target: typescript + source: my-first-source + output: ./typescript diff --git a/typescript/.eslintrc.js b/typescript/.eslintrc.js new file mode 100644 index 00000000..4d160bd2 --- /dev/null +++ b/typescript/.eslintrc.js @@ -0,0 +1,28 @@ +/* eslint-env node */ +module.exports = { + root: true, + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:import/recommended", + "plugin:import/typescript", + ], + parser: "@typescript-eslint/parser", + plugins: ["@typescript-eslint"], + settings: { + "import/resolver": { + typescript: true, + node: true, + }, + }, + rules: { + // Handled by typescript compiler + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/no-explicit-any": "off", + "import/no-named-as-default-member": "off", + + "import/no-default-export": "error", + }, +}; diff --git a/typescript/.gitattributes b/typescript/.gitattributes new file mode 100644 index 00000000..113eead5 --- /dev/null +++ b/typescript/.gitattributes @@ -0,0 +1,2 @@ +# This allows generated code to be indexed correctly +*.ts linguist-generated=false \ No newline at end of file diff --git a/typescript/.gitignore b/typescript/.gitignore new file mode 100644 index 00000000..cc2681a5 --- /dev/null +++ b/typescript/.gitignore @@ -0,0 +1,10 @@ +/models +/models/errors +/types +/lib +/sdk +/hooks +/index.* +/cjs +/node_modules +/.tsbuildinfo diff --git a/typescript/.npmignore b/typescript/.npmignore new file mode 100644 index 00000000..e8a556cd --- /dev/null +++ b/typescript/.npmignore @@ -0,0 +1,8 @@ +/* +/docs/**/*.md +!/**/*.ts +!/**/*.js +!/**/*.map + +/.eslintrc.js +/cjs diff --git a/typescript/.speakeasy/gen.lock b/typescript/.speakeasy/gen.lock new file mode 100755 index 00000000..7d85d78b --- /dev/null +++ b/typescript/.speakeasy/gen.lock @@ -0,0 +1,201 @@ +lockVersion: 2.0.0 +id: 5a9e3c33-b1e6-43e2-8de6-5afbfcf74896 +management: + docChecksum: b1d12231accc98a1d3f77a8c4dbd3ab4 + docVersion: 0.0.1 + speakeasyVersion: 1.244.0 + generationVersion: 2.301.0 + releaseVersion: 0.18.3 + configChecksum: df48e024b99e6b2abb07c6eafc8d5bfd +features: + typescript: + acceptHeaders: 2.81.1 + constsAndDefaults: 0.1.5 + core: 3.7.1 + deprecations: 2.81.1 + globalSecurity: 2.82.9 + globalServerURLs: 2.82.4 + responseFormat: 0.2.3 + unions: 2.85.3 +generatedFiles: + - src/sdk/links.ts + - src/sdk/qrcodes.ts + - src/sdk/analytics.ts + - src/sdk/workspaces.ts + - src/sdk/tags.ts + - src/sdk/sdk.ts + - .eslintrc.js + - .npmignore + - RUNTIMES.md + - package.json + - src/index.ts + - src/lib/base64.ts + - src/lib/config.ts + - src/lib/encodings.ts + - src/lib/http.ts + - src/lib/retries.ts + - src/lib/schemas.ts + - src/lib/sdks.ts + - src/lib/security.ts + - src/lib/url.ts + - src/sdk/index.ts + - src/models/errors/sdkerror.ts + - src/models/errors/sdkvalidationerror.ts + - src/types/blobs.ts + - src/types/index.ts + - src/types/operations.ts + - src/types/rfcdate.ts + - tsconfig.json + - src/models/components/linkschema.ts + - src/models/components/tagschema.ts + - src/models/components/workspaceschema.ts + - src/models/components/security.ts + - src/models/errors/fourhundred.ts + - src/models/errors/fourhundredandone.ts + - src/models/errors/fourhundredandthree.ts + - src/models/errors/fourhundredandfour.ts + - src/models/errors/fourhundredandnine.ts + - src/models/errors/fourhundredandten.ts + - src/models/errors/fourhundredandtwentytwo.ts + - src/models/errors/fourhundredandtwentynine.ts + - src/models/errors/fivehundred.ts + - src/models/operations/getlinks.ts + - src/models/operations/createlink.ts + - src/models/operations/getlinkscount.ts + - src/models/operations/getlinkinfo.ts + - src/models/operations/editlink.ts + - src/models/operations/deletelink.ts + - src/models/operations/bulkcreatelinks.ts + - src/models/operations/getqrcode.ts + - src/models/operations/getclicksanalytics.ts + - src/models/operations/gettimeseriesanalytics.ts + - src/models/operations/getcountryanalytics.ts + - src/models/operations/getcityanalytics.ts + - src/models/operations/getdeviceanalytics.ts + - src/models/operations/getbrowseranalytics.ts + - src/models/operations/getosanalytics.ts + - src/models/operations/getrefereranalytics.ts + - src/models/operations/gettoplinks.ts + - src/models/operations/gettopurls.ts + - src/models/operations/createworkspace.ts + - src/models/operations/getworkspace.ts + - src/models/operations/gettags.ts + - src/models/operations/createtag.ts + - src/models/errors/index.ts + - src/models/components/index.ts + - src/models/operations/index.ts + - docs/models/components/linkschema.md + - docs/models/components/color.md + - docs/models/components/tagschema.md + - docs/models/components/plan.md + - docs/models/components/role.md + - docs/models/components/users.md + - docs/models/components/domains.md + - docs/models/components/workspaceschema.md + - docs/models/components/security.md + - docs/models/errors/code.md + - docs/models/errors/errort.md + - docs/models/errors/fourhundred.md + - docs/models/errors/fourhundredandonecode.md + - docs/models/errors/fourhundredandoneerror.md + - docs/models/errors/fourhundredandone.md + - docs/models/errors/fourhundredandthreecode.md + - docs/models/errors/fourhundredandthreeerror.md + - docs/models/errors/fourhundredandthree.md + - docs/models/errors/fourhundredandfourcode.md + - docs/models/errors/fourhundredandfourerror.md + - docs/models/errors/fourhundredandfour.md + - docs/models/errors/fourhundredandninecode.md + - docs/models/errors/fourhundredandnineerror.md + - docs/models/errors/fourhundredandnine.md + - docs/models/errors/fourhundredandtencode.md + - docs/models/errors/fourhundredandtenerror.md + - docs/models/errors/fourhundredandten.md + - docs/models/errors/fourhundredandtwentytwocode.md + - docs/models/errors/fourhundredandtwentytwoerror.md + - docs/models/errors/fourhundredandtwentytwo.md + - docs/models/errors/fourhundredandtwentyninecode.md + - docs/models/errors/fourhundredandtwentynineerror.md + - docs/models/errors/fourhundredandtwentynine.md + - docs/models/errors/fivehundredcode.md + - docs/models/errors/fivehundrederror.md + - docs/models/errors/fivehundred.md + - docs/models/operations/queryparamtagids.md + - docs/models/operations/sort.md + - docs/models/operations/getlinksrequest.md + - docs/models/operations/tagids.md + - docs/models/operations/createlinkrequestbody.md + - docs/models/operations/createlinkrequest.md + - docs/models/operations/getlinkscountqueryparamtagids.md + - docs/models/operations/two.md + - docs/models/operations/one.md + - docs/models/operations/groupby.md + - docs/models/operations/getlinkscountrequest.md + - docs/models/operations/getlinkinforequest.md + - docs/models/operations/editlinktagids.md + - docs/models/operations/editlinkrequestbody.md + - docs/models/operations/editlinkrequest.md + - docs/models/operations/deletelinkrequest.md + - docs/models/operations/bulkcreatelinkstagids.md + - docs/models/operations/requestbody.md + - docs/models/operations/bulkcreatelinksrequest.md + - docs/models/operations/level.md + - docs/models/operations/getqrcoderequest.md + - docs/models/operations/interval.md + - docs/models/operations/country.md + - docs/models/operations/getclicksanalyticsrequest.md + - docs/models/operations/queryparaminterval.md + - docs/models/operations/queryparamcountry.md + - docs/models/operations/gettimeseriesanalyticsrequest.md + - docs/models/operations/responsebody.md + - docs/models/operations/getcountryanalyticsqueryparaminterval.md + - docs/models/operations/getcountryanalyticsqueryparamcountry.md + - docs/models/operations/getcountryanalyticsrequest.md + - docs/models/operations/getcountryanalyticscountry.md + - docs/models/operations/getcountryanalyticsresponsebody.md + - docs/models/operations/getcityanalyticsqueryparaminterval.md + - docs/models/operations/getcityanalyticsqueryparamcountry.md + - docs/models/operations/getcityanalyticsrequest.md + - docs/models/operations/getcityanalyticscountry.md + - docs/models/operations/getcityanalyticsresponsebody.md + - docs/models/operations/getdeviceanalyticsqueryparaminterval.md + - docs/models/operations/getdeviceanalyticsqueryparamcountry.md + - docs/models/operations/getdeviceanalyticsrequest.md + - docs/models/operations/getdeviceanalyticsresponsebody.md + - docs/models/operations/getbrowseranalyticsqueryparaminterval.md + - docs/models/operations/getbrowseranalyticsqueryparamcountry.md + - docs/models/operations/getbrowseranalyticsrequest.md + - docs/models/operations/getbrowseranalyticsresponsebody.md + - docs/models/operations/getosanalyticsqueryparaminterval.md + - docs/models/operations/getosanalyticsqueryparamcountry.md + - docs/models/operations/getosanalyticsrequest.md + - docs/models/operations/getosanalyticsresponsebody.md + - docs/models/operations/getrefereranalyticsqueryparaminterval.md + - docs/models/operations/getrefereranalyticsqueryparamcountry.md + - docs/models/operations/getrefereranalyticsrequest.md + - docs/models/operations/getrefereranalyticsresponsebody.md + - docs/models/operations/gettoplinksqueryparaminterval.md + - docs/models/operations/gettoplinksqueryparamcountry.md + - docs/models/operations/gettoplinksrequest.md + - docs/models/operations/gettoplinksresponsebody.md + - docs/models/operations/gettopurlsqueryparaminterval.md + - docs/models/operations/gettopurlsqueryparamcountry.md + - docs/models/operations/gettopurlsrequest.md + - docs/models/operations/gettopurlsresponsebody.md + - docs/models/operations/createworkspacerequestbody.md + - docs/models/operations/getworkspacerequest.md + - docs/models/operations/gettagsrequest.md + - docs/models/operations/color.md + - docs/models/operations/createtagrequestbody.md + - docs/models/operations/createtagrequest.md + - docs/sdks/dub/README.md + - docs/sdks/links/README.md + - docs/sdks/qrcodes/README.md + - docs/sdks/analytics/README.md + - docs/sdks/workspaces/README.md + - docs/sdks/tags/README.md + - USAGE.md + - .gitattributes + - src/hooks/hooks.ts + - src/hooks/types.ts + - src/hooks/index.ts diff --git a/typescript/README.md b/typescript/README.md new file mode 100644 index 00000000..1a3da1e9 --- /dev/null +++ b/typescript/README.md @@ -0,0 +1,365 @@ +# dub + +
+ + + + +
+ + +## 🏗 **Welcome to your new SDK!** 🏗 + +It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps: +- [ ] 🛠 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks) +- [ ] ♻️ Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy) +- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/advanced-setup/publish-sdks) +- [ ] ✨ When ready to productionize, delete this section from the README + + +## SDK Installation + +### NPM + +```bash +npm add +``` + +### Yarn + +```bash +yarn add +``` + + + +## Requirements + +For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md). + + + +## SDK Example Usage + +### Example + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.links.getLinks({ + workspaceId: "", + tagIds: "", + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + + + +## Available Resources and Operations + +### [links](docs/sdks/links/README.md) + +* [getLinks](docs/sdks/links/README.md#getlinks) - Retrieve a list of links +* [createLink](docs/sdks/links/README.md#createlink) - Create a new link +* [getLinksCount](docs/sdks/links/README.md#getlinkscount) - Retrieve the number of links +* [getLinkInfo](docs/sdks/links/README.md#getlinkinfo) - Retrieve a link +* [editLink](docs/sdks/links/README.md#editlink) - Edit a link +* [deleteLink](docs/sdks/links/README.md#deletelink) - Delete a link +* [bulkCreateLinks](docs/sdks/links/README.md#bulkcreatelinks) - Bulk create links + +### [qrCodes](docs/sdks/qrcodes/README.md) + +* [getQRCode](docs/sdks/qrcodes/README.md#getqrcode) - Retrieve a QR code + +### [analytics](docs/sdks/analytics/README.md) + +* [getClicksAnalytics](docs/sdks/analytics/README.md#getclicksanalytics) - Retrieve clicks analytics +* [getTimeseriesAnalytics](docs/sdks/analytics/README.md#gettimeseriesanalytics) - Retrieve timeseries analytics +* [getCountryAnalytics](docs/sdks/analytics/README.md#getcountryanalytics) - Retrieve country analytics +* [getCityAnalytics](docs/sdks/analytics/README.md#getcityanalytics) - Retrieve city analytics +* [getDeviceAnalytics](docs/sdks/analytics/README.md#getdeviceanalytics) - Retrieve device analytics +* [getBrowserAnalytics](docs/sdks/analytics/README.md#getbrowseranalytics) - Retrieve browser analytics +* [getOSAnalytics](docs/sdks/analytics/README.md#getosanalytics) - Retrieve OS analytics +* [getRefererAnalytics](docs/sdks/analytics/README.md#getrefereranalytics) - Retrieve referer analytics +* [getTopLinks](docs/sdks/analytics/README.md#gettoplinks) - Retrieve top links +* [getTopURLs](docs/sdks/analytics/README.md#gettopurls) - Retrieve top URLs + +### [workspaces](docs/sdks/workspaces/README.md) + +* [getWorkspaces](docs/sdks/workspaces/README.md#getworkspaces) - Retrieve a list of workspaces +* [createWorkspace](docs/sdks/workspaces/README.md#createworkspace) - Create a workspace +* [getWorkspace](docs/sdks/workspaces/README.md#getworkspace) - Retrieve a workspace + +### [tags](docs/sdks/tags/README.md) + +* [getTags](docs/sdks/tags/README.md#gettags) - Retrieve a list of tags +* [createTag](docs/sdks/tags/README.md#createtag) - Create a new tag + + + +## Error Handling + +All SDK methods return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type. + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging. + + +```typescript +import { Dub } from "dub"; +import * as errors from "dub/models/errors"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + let result; + try { + result = await sdk.links.getLinks({ + workspaceId: "", + tagIds: "", + }); + } catch (err) { + switch (true) { + case err instanceof errors.SDKValidationError: { + // Validation errors can be pretty-printed + console.error(err.pretty()); + // Raw value may also be inspected + console.error(err.rawValue); + return; + } + case err instanceof errors.FourHundred: { + console.error(err); // handle exception + return; + } + case err instanceof errors.FourHundredAndOne: { + console.error(err); // handle exception + return; + } + case err instanceof errors.FourHundredAndThree: { + console.error(err); // handle exception + return; + } + case err instanceof errors.FourHundredAndFour: { + console.error(err); // handle exception + return; + } + case err instanceof errors.FourHundredAndNine: { + console.error(err); // handle exception + return; + } + case err instanceof errors.FourHundredAndTen: { + console.error(err); // handle exception + return; + } + case err instanceof errors.FourHundredAndTwentyTwo: { + console.error(err); // handle exception + return; + } + case err instanceof errors.FourHundredAndTwentyNine: { + console.error(err); // handle exception + return; + } + case err instanceof errors.FiveHundred: { + console.error(err); // handle exception + return; + } + default: { + throw err; + } + } + } + + // Handle the result + console.log(result); +} + +run(); + +``` + + + +## Server Selection + +### Select Server by Index + +You can override the default server globally by passing a server index to the `serverIdx` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: + +| # | Server | Variables | +| - | ------ | --------- | +| 0 | `https://api.dub.co` | None | + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + serverIdx: 0, + bearerToken: "", + }); + + const result = await sdk.links.getLinks({ + workspaceId: "", + tagIds: "", + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + + +### Override Server URL Per-Client + +The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example: + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + serverURL: "https://api.dub.co", + bearerToken: "", + }); + + const result = await sdk.links.getLinks({ + workspaceId: "", + tagIds: "", + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + + + +## Custom HTTP Client + +The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native +[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This +client is a thin wrapper around `fetch` and provides the ability to attach hooks +around the request lifecycle that can be used to modify the request or handle +errors and response. + +The `HTTPClient` constructor takes an optional `fetcher` argument that can be +used to integrate a third-party HTTP client or when writing tests to mock out +the HTTP client and feed in fixtures. + +The following example shows how to use the `"beforeRequest"` hook to to add a +custom header and a timeout to requests and how to use the `"requestError"` hook +to log errors: + +```typescript +import { Dub } from "dub"; +import { HTTPClient } from "dub/lib/http"; + +const httpClient = new HTTPClient({ + // fetcher takes a function that has the same signature as native `fetch`. + fetcher: (request) => { + return fetch(request); + } +}); + +httpClient.addHook("beforeRequest", (request) => { + const nextRequest = new Request(request, { + signal: request.signal || AbortSignal.timeout(5000); + }); + + nextRequest.headers.set("x-custom-header", "custom value"); + + return nextRequest; +}); + +httpClient.addHook("requestError", (error, request) => { + console.group("Request Error"); + console.log("Reason:", `${error}`); + console.log("Endpoint:", `${request.method} ${request.url}`); + console.groupEnd(); +}); + +const sdk = new Dub({ httpClient }); +``` + + + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security scheme globally: + +| Name | Type | Scheme | +| ------------- | ------------- | ------------- | +| `bearerToken` | http | HTTP Bearer | + +To authenticate with the API the `bearerToken` parameter must be set when initializing the SDK client instance. For example: +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.links.getLinks({ + workspaceId: "", + tagIds: "", + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + + + + +# Development + +## Maturity + +This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage +to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally +looking for the latest version. + +## Contributions + +While we value open-source contributions to this SDK, this library is generated programmatically. +Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release! + +### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks) diff --git a/typescript/RUNTIMES.md b/typescript/RUNTIMES.md new file mode 100644 index 00000000..71fa3dae --- /dev/null +++ b/typescript/RUNTIMES.md @@ -0,0 +1,22 @@ +# Supported JavaScript runtimes + +This SDK is intended to be used in JavaScript runtimes that support the following features: + +* [Web Fetch API][web-fetch] +* [Web Streams API](web-streams) and in particular `ReadableStream` +* [Async iterables][async-iter] using `Symbol.asyncIterator` + +[web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API +[web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API +[async-iter]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols + +Runtime environments that are explicitly supported are: + +- Evergreen browsers which include: Chrome, Safari, Edge, Firefox +- Node.js active and maintenance LTS releases + - Currently, this is v18 and v20 +- Bun v1 and above +- Deno v1.39 + - Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming]) + +[deno-file-streaming]: https://github.com/denoland/deno/issues/11018 diff --git a/typescript/USAGE.md b/typescript/USAGE.md new file mode 100644 index 00000000..062bd164 --- /dev/null +++ b/typescript/USAGE.md @@ -0,0 +1,22 @@ + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.links.getLinks({ + workspaceId: "", + tagIds: "", + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + \ No newline at end of file diff --git a/typescript/docs/models/components/color.md b/typescript/docs/models/components/color.md new file mode 100644 index 00000000..daf69eb9 --- /dev/null +++ b/typescript/docs/models/components/color.md @@ -0,0 +1,16 @@ +# Color + +The color of the tag. + + +## Values + +| Name | Value | +| -------- | -------- | +| `Red` | red | +| `Yellow` | yellow | +| `Green` | green | +| `Blue` | blue | +| `Purple` | purple | +| `Pink` | pink | +| `Brown` | brown | \ No newline at end of file diff --git a/typescript/docs/models/components/domains.md b/typescript/docs/models/components/domains.md new file mode 100644 index 00000000..86747c6c --- /dev/null +++ b/typescript/docs/models/components/domains.md @@ -0,0 +1,8 @@ +# Domains + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `slug` | *string* | :heavy_check_mark: | The domain of the workspace. | \ No newline at end of file diff --git a/typescript/docs/models/components/linkschema.md b/typescript/docs/models/components/linkschema.md new file mode 100644 index 00000000..6c626f72 --- /dev/null +++ b/typescript/docs/models/components/linkschema.md @@ -0,0 +1,41 @@ +# LinkSchema + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The unique ID of the short link. | +| `domain` | *string* | :heavy_check_mark: | The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). | +| `key` | *string* | :heavy_check_mark: | The short link slug. If not provided, a random 7-character slug will be generated. | +| `url` | *string* | :heavy_check_mark: | The destination URL of the short link. | +| `archived` | *boolean* | :heavy_minus_sign: | Whether the short link is archived. | +| `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The date and time when the short link will expire in ISO-8601 format. | +| `expiredUrl` | *string* | :heavy_check_mark: | The URL to redirect to when the short link has expired. | +| `password` | *string* | :heavy_check_mark: | The password required to access the destination URL of the short link. | +| `proxy` | *boolean* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | +| `title` | *string* | :heavy_check_mark: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `description` | *string* | :heavy_check_mark: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `image` | *string* | :heavy_check_mark: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `rewrite` | *boolean* | :heavy_minus_sign: | Whether the short link uses link cloaking. | +| `ios` | *string* | :heavy_check_mark: | The iOS destination URL for the short link for iOS device targeting. | +| `android` | *string* | :heavy_check_mark: | The Android destination URL for the short link for Android device targeting. | +| `geo` | Record | :heavy_check_mark: | Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo | +| `publicStats` | *boolean* | :heavy_minus_sign: | Whether the short link's stats are publicly accessible. | +| ~~`tagId`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

[DEPRECATED] (use `tags` instead): The unique ID of the tag assigned to the short link. | +| `tags` | [components.TagSchema](../../models/components/tagschema.md)[] | :heavy_check_mark: | The tags assigned to the short link. | +| `comments` | *string* | :heavy_check_mark: | The comments for the short link. | +| `shortLink` | *string* | :heavy_check_mark: | The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). | +| `qrCode` | *string* | :heavy_check_mark: | The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). | +| `utmSource` | *string* | :heavy_check_mark: | The UTM source of the short link. | +| `utmMedium` | *string* | :heavy_check_mark: | The UTM medium of the short link. | +| `utmCampaign` | *string* | :heavy_check_mark: | The UTM campaign of the short link. | +| `utmTerm` | *string* | :heavy_check_mark: | The UTM term of the short link. | +| `utmContent` | *string* | :heavy_check_mark: | The UTM content of the short link. | +| `userId` | *string* | :heavy_check_mark: | The user ID of the creator of the short link. | +| `workspaceId` | *string* | :heavy_check_mark: | The workspace ID of the short link. | +| `clicks` | *number* | :heavy_minus_sign: | The number of clicks on the short link. | +| `lastClicked` | *string* | :heavy_check_mark: | The date and time when the short link was last clicked. | +| `createdAt` | *string* | :heavy_check_mark: | The date and time when the short link was created. | +| `updatedAt` | *string* | :heavy_check_mark: | The date and time when the short link was last updated. | +| ~~`projectId`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

[DEPRECATED] (use workspaceId instead): The project ID of the short link. | \ No newline at end of file diff --git a/typescript/docs/models/components/plan.md b/typescript/docs/models/components/plan.md new file mode 100644 index 00000000..4fa64b49 --- /dev/null +++ b/typescript/docs/models/components/plan.md @@ -0,0 +1,16 @@ +# Plan + +The plan of the workspace. + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `Free` | free | +| `Pro` | pro | +| `Business` | business | +| `BusinessPlus` | business plus | +| `BusinessExtra` | business extra | +| `BusinessMax` | business max | +| `Enterprise` | enterprise | \ No newline at end of file diff --git a/typescript/docs/models/components/role.md b/typescript/docs/models/components/role.md new file mode 100644 index 00000000..b31a2d0f --- /dev/null +++ b/typescript/docs/models/components/role.md @@ -0,0 +1,11 @@ +# Role + +The role of the authenticated user in the workspace. + + +## Values + +| Name | Value | +| -------- | -------- | +| `Owner` | owner | +| `Member` | member | \ No newline at end of file diff --git a/typescript/docs/models/components/security.md b/typescript/docs/models/components/security.md new file mode 100644 index 00000000..e0cdb4c5 --- /dev/null +++ b/typescript/docs/models/components/security.md @@ -0,0 +1,8 @@ +# Security + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `bearerToken` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/components/tagschema.md b/typescript/docs/models/components/tagschema.md new file mode 100644 index 00000000..ecebdfb2 --- /dev/null +++ b/typescript/docs/models/components/tagschema.md @@ -0,0 +1,10 @@ +# TagSchema + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The unique ID of the tag. | +| `name` | *string* | :heavy_check_mark: | The name of the tag. | +| `color` | [components.Color](../../models/components/color.md) | :heavy_check_mark: | The color of the tag. | \ No newline at end of file diff --git a/typescript/docs/models/components/users.md b/typescript/docs/models/components/users.md new file mode 100644 index 00000000..785c1016 --- /dev/null +++ b/typescript/docs/models/components/users.md @@ -0,0 +1,8 @@ +# Users + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `role` | [components.Role](../../models/components/role.md) | :heavy_check_mark: | The role of the authenticated user in the workspace. | \ No newline at end of file diff --git a/typescript/docs/models/components/workspaceschema.md b/typescript/docs/models/components/workspaceschema.md new file mode 100644 index 00000000..7924e622 --- /dev/null +++ b/typescript/docs/models/components/workspaceschema.md @@ -0,0 +1,24 @@ +# WorkspaceSchema + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The unique ID of the workspace. | +| `name` | *string* | :heavy_check_mark: | The name of the workspace. | +| `slug` | *string* | :heavy_check_mark: | The slug of the workspace. | +| `logo` | *string* | :heavy_minus_sign: | The logo of the workspace. | +| `usage` | *number* | :heavy_check_mark: | The usage of the workspace. | +| `usageLimit` | *number* | :heavy_check_mark: | The usage limit of the workspace. | +| `linksUsage` | *number* | :heavy_check_mark: | The links usage of the workspace. | +| `linksLimit` | *number* | :heavy_check_mark: | The links limit of the workspace. | +| `domainsLimit` | *number* | :heavy_check_mark: | The domains limit of the workspace. | +| `tagsLimit` | *number* | :heavy_check_mark: | The tags limit of the workspace. | +| `usersLimit` | *number* | :heavy_check_mark: | The users limit of the workspace. | +| `plan` | [components.Plan](../../models/components/plan.md) | :heavy_check_mark: | The plan of the workspace. | +| `stripeId` | *string* | :heavy_check_mark: | The Stripe ID of the workspace. | +| `billingCycleStart` | *number* | :heavy_check_mark: | The date and time when the billing cycle starts for the workspace. | +| `createdAt` | *string* | :heavy_check_mark: | The date and time when the workspace was created. | +| `users` | [components.Users](../../models/components/users.md)[] | :heavy_check_mark: | The role of the authenticated user in the workspace. | +| `domains` | [components.Domains](../../models/components/domains.md)[] | :heavy_check_mark: | The domains of the workspace. | \ No newline at end of file diff --git a/typescript/docs/models/errors/badrequest.md b/typescript/docs/models/errors/badrequest.md new file mode 100644 index 00000000..fb4f9cd5 --- /dev/null +++ b/typescript/docs/models/errors/badrequest.md @@ -0,0 +1,10 @@ +# BadRequest + +The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `error` | [errors.ErrorT](../../models/errors/errort.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/code.md b/typescript/docs/models/errors/code.md new file mode 100644 index 00000000..a9b8b0eb --- /dev/null +++ b/typescript/docs/models/errors/code.md @@ -0,0 +1,10 @@ +# Code + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `BadRequest` | bad_request | \ No newline at end of file diff --git a/typescript/docs/models/errors/conflict.md b/typescript/docs/models/errors/conflict.md new file mode 100644 index 00000000..0d34b804 --- /dev/null +++ b/typescript/docs/models/errors/conflict.md @@ -0,0 +1,10 @@ +# Conflict + +This response is sent when a request conflicts with the current state of the server. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `error` | [errors.ConflictError](../../models/errors/conflicterror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/conflictcode.md b/typescript/docs/models/errors/conflictcode.md new file mode 100644 index 00000000..926a204a --- /dev/null +++ b/typescript/docs/models/errors/conflictcode.md @@ -0,0 +1,10 @@ +# ConflictCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `Conflict` | conflict | \ No newline at end of file diff --git a/typescript/docs/models/errors/conflicterror.md b/typescript/docs/models/errors/conflicterror.md new file mode 100644 index 00000000..8434be85 --- /dev/null +++ b/typescript/docs/models/errors/conflicterror.md @@ -0,0 +1,10 @@ +# ConflictError + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `code` | [errors.ConflictCode](../../models/errors/conflictcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | conflict | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#conflict | \ No newline at end of file diff --git a/typescript/docs/models/errors/errort.md b/typescript/docs/models/errors/errort.md new file mode 100644 index 00000000..b8b44f20 --- /dev/null +++ b/typescript/docs/models/errors/errort.md @@ -0,0 +1,10 @@ +# ErrorT + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `code` | [errors.Code](../../models/errors/code.md) | :heavy_check_mark: | A short code indicating the error code returned. | bad_request | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#bad_request | \ No newline at end of file diff --git a/typescript/docs/models/errors/fivehundred.md b/typescript/docs/models/errors/fivehundred.md new file mode 100644 index 00000000..24e716de --- /dev/null +++ b/typescript/docs/models/errors/fivehundred.md @@ -0,0 +1,10 @@ +# FiveHundred + +The server has encountered a situation it does not know how to handle. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `error` | [errors.FiveHundredError](../../models/errors/fivehundrederror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/fivehundredcode.md b/typescript/docs/models/errors/fivehundredcode.md new file mode 100644 index 00000000..321587f0 --- /dev/null +++ b/typescript/docs/models/errors/fivehundredcode.md @@ -0,0 +1,10 @@ +# FiveHundredCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `InternalServerError` | internal_server_error | \ No newline at end of file diff --git a/typescript/docs/models/errors/fivehundrederror.md b/typescript/docs/models/errors/fivehundrederror.md new file mode 100644 index 00000000..f77df2af --- /dev/null +++ b/typescript/docs/models/errors/fivehundrederror.md @@ -0,0 +1,10 @@ +# FiveHundredError + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `code` | [errors.FiveHundredCode](../../models/errors/fivehundredcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | internal_server_error | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#internal_server_error | \ No newline at end of file diff --git a/typescript/docs/models/errors/forbidden.md b/typescript/docs/models/errors/forbidden.md new file mode 100644 index 00000000..1017e84f --- /dev/null +++ b/typescript/docs/models/errors/forbidden.md @@ -0,0 +1,10 @@ +# Forbidden + +The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `error` | [errors.ForbiddenError](../../models/errors/forbiddenerror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/forbiddencode.md b/typescript/docs/models/errors/forbiddencode.md new file mode 100644 index 00000000..85694c2a --- /dev/null +++ b/typescript/docs/models/errors/forbiddencode.md @@ -0,0 +1,10 @@ +# ForbiddenCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `Forbidden` | forbidden | \ No newline at end of file diff --git a/typescript/docs/models/errors/forbiddenerror.md b/typescript/docs/models/errors/forbiddenerror.md new file mode 100644 index 00000000..66e56414 --- /dev/null +++ b/typescript/docs/models/errors/forbiddenerror.md @@ -0,0 +1,10 @@ +# ForbiddenError + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `code` | [errors.ForbiddenCode](../../models/errors/forbiddencode.md) | :heavy_check_mark: | A short code indicating the error code returned. | forbidden | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#forbidden | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundred.md b/typescript/docs/models/errors/fourhundred.md new file mode 100644 index 00000000..a25cbd62 --- /dev/null +++ b/typescript/docs/models/errors/fourhundred.md @@ -0,0 +1,10 @@ +# FourHundred + +The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `error` | [errors.ErrorT](../../models/errors/errort.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandfour.md b/typescript/docs/models/errors/fourhundredandfour.md new file mode 100644 index 00000000..db441e43 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandfour.md @@ -0,0 +1,10 @@ +# FourHundredAndFour + +The server cannot find the requested resource. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `error` | [errors.FourHundredAndFourError](../../models/errors/fourhundredandfourerror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandfourcode.md b/typescript/docs/models/errors/fourhundredandfourcode.md new file mode 100644 index 00000000..d86ad504 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandfourcode.md @@ -0,0 +1,10 @@ +# FourHundredAndFourCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `NotFound` | not_found | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandfourerror.md b/typescript/docs/models/errors/fourhundredandfourerror.md new file mode 100644 index 00000000..2ccfc168 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandfourerror.md @@ -0,0 +1,10 @@ +# FourHundredAndFourError + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `code` | [errors.FourHundredAndFourCode](../../models/errors/fourhundredandfourcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | not_found | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#not_found | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandnine.md b/typescript/docs/models/errors/fourhundredandnine.md new file mode 100644 index 00000000..39b08b4f --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandnine.md @@ -0,0 +1,10 @@ +# FourHundredAndNine + +This response is sent when a request conflicts with the current state of the server. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `error` | [errors.FourHundredAndNineError](../../models/errors/fourhundredandnineerror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandninecode.md b/typescript/docs/models/errors/fourhundredandninecode.md new file mode 100644 index 00000000..d8f4e2d2 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandninecode.md @@ -0,0 +1,10 @@ +# FourHundredAndNineCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `Conflict` | conflict | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandnineerror.md b/typescript/docs/models/errors/fourhundredandnineerror.md new file mode 100644 index 00000000..1cba2fe7 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandnineerror.md @@ -0,0 +1,10 @@ +# FourHundredAndNineError + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `code` | [errors.FourHundredAndNineCode](../../models/errors/fourhundredandninecode.md) | :heavy_check_mark: | A short code indicating the error code returned. | conflict | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#conflict | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandone.md b/typescript/docs/models/errors/fourhundredandone.md new file mode 100644 index 00000000..a06255bd --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandone.md @@ -0,0 +1,10 @@ +# FourHundredAndOne + +Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `error` | [errors.FourHundredAndOneError](../../models/errors/fourhundredandoneerror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandonecode.md b/typescript/docs/models/errors/fourhundredandonecode.md new file mode 100644 index 00000000..7743c7d9 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandonecode.md @@ -0,0 +1,10 @@ +# FourHundredAndOneCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `Unauthorized` | unauthorized | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandoneerror.md b/typescript/docs/models/errors/fourhundredandoneerror.md new file mode 100644 index 00000000..88f71ade --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandoneerror.md @@ -0,0 +1,10 @@ +# FourHundredAndOneError + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `code` | [errors.FourHundredAndOneCode](../../models/errors/fourhundredandonecode.md) | :heavy_check_mark: | A short code indicating the error code returned. | unauthorized | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#unauthorized | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandten.md b/typescript/docs/models/errors/fourhundredandten.md new file mode 100644 index 00000000..73e71c9f --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandten.md @@ -0,0 +1,10 @@ +# FourHundredAndTen + +This response is sent when the requested content has been permanently deleted from server, with no forwarding address. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `error` | [errors.FourHundredAndTenError](../../models/errors/fourhundredandtenerror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandtencode.md b/typescript/docs/models/errors/fourhundredandtencode.md new file mode 100644 index 00000000..5f4f8f6c --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandtencode.md @@ -0,0 +1,10 @@ +# FourHundredAndTenCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `InviteExpired` | invite_expired | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandtenerror.md b/typescript/docs/models/errors/fourhundredandtenerror.md new file mode 100644 index 00000000..7faced96 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandtenerror.md @@ -0,0 +1,10 @@ +# FourHundredAndTenError + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `code` | [errors.FourHundredAndTenCode](../../models/errors/fourhundredandtencode.md) | :heavy_check_mark: | A short code indicating the error code returned. | invite_expired | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#invite_expired | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandthree.md b/typescript/docs/models/errors/fourhundredandthree.md new file mode 100644 index 00000000..2e52b111 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandthree.md @@ -0,0 +1,10 @@ +# FourHundredAndThree + +The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `error` | [errors.FourHundredAndThreeError](../../models/errors/fourhundredandthreeerror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandthreecode.md b/typescript/docs/models/errors/fourhundredandthreecode.md new file mode 100644 index 00000000..5aee4d29 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandthreecode.md @@ -0,0 +1,10 @@ +# FourHundredAndThreeCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `Forbidden` | forbidden | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandthreeerror.md b/typescript/docs/models/errors/fourhundredandthreeerror.md new file mode 100644 index 00000000..c57d4649 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandthreeerror.md @@ -0,0 +1,10 @@ +# FourHundredAndThreeError + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `code` | [errors.FourHundredAndThreeCode](../../models/errors/fourhundredandthreecode.md) | :heavy_check_mark: | A short code indicating the error code returned. | forbidden | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#forbidden | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandtwentynine.md b/typescript/docs/models/errors/fourhundredandtwentynine.md new file mode 100644 index 00000000..0cb174d1 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandtwentynine.md @@ -0,0 +1,10 @@ +# FourHundredAndTwentyNine + +The user has sent too many requests in a given amount of time ("rate limiting") + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `error` | [errors.FourHundredAndTwentyNineError](../../models/errors/fourhundredandtwentynineerror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandtwentyninecode.md b/typescript/docs/models/errors/fourhundredandtwentyninecode.md new file mode 100644 index 00000000..4d333c91 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandtwentyninecode.md @@ -0,0 +1,10 @@ +# FourHundredAndTwentyNineCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `RateLimitExceeded` | rate_limit_exceeded | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandtwentynineerror.md b/typescript/docs/models/errors/fourhundredandtwentynineerror.md new file mode 100644 index 00000000..b1159e78 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandtwentynineerror.md @@ -0,0 +1,10 @@ +# FourHundredAndTwentyNineError + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `code` | [errors.FourHundredAndTwentyNineCode](../../models/errors/fourhundredandtwentyninecode.md) | :heavy_check_mark: | A short code indicating the error code returned. | rate_limit_exceeded | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#rate_limit_exceeded | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandtwentytwo.md b/typescript/docs/models/errors/fourhundredandtwentytwo.md new file mode 100644 index 00000000..d97c0e26 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandtwentytwo.md @@ -0,0 +1,10 @@ +# FourHundredAndTwentyTwo + +The request was well-formed but was unable to be followed due to semantic errors. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `error` | [errors.FourHundredAndTwentyTwoError](../../models/errors/fourhundredandtwentytwoerror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandtwentytwocode.md b/typescript/docs/models/errors/fourhundredandtwentytwocode.md new file mode 100644 index 00000000..c8498460 --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandtwentytwocode.md @@ -0,0 +1,10 @@ +# FourHundredAndTwentyTwoCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `UnprocessableEntity` | unprocessable_entity | \ No newline at end of file diff --git a/typescript/docs/models/errors/fourhundredandtwentytwoerror.md b/typescript/docs/models/errors/fourhundredandtwentytwoerror.md new file mode 100644 index 00000000..7390f9bc --- /dev/null +++ b/typescript/docs/models/errors/fourhundredandtwentytwoerror.md @@ -0,0 +1,10 @@ +# FourHundredAndTwentyTwoError + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `code` | [errors.FourHundredAndTwentyTwoCode](../../models/errors/fourhundredandtwentytwocode.md) | :heavy_check_mark: | A short code indicating the error code returned. | unprocessable_entity | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#unprocessable_entity | \ No newline at end of file diff --git a/typescript/docs/models/errors/internalservererror.md b/typescript/docs/models/errors/internalservererror.md new file mode 100644 index 00000000..7809e04e --- /dev/null +++ b/typescript/docs/models/errors/internalservererror.md @@ -0,0 +1,10 @@ +# InternalServerError + +The server has encountered a situation it does not know how to handle. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `error` | [errors.InternalServerErrorError](../../models/errors/internalservererrorerror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/internalservererrorcode.md b/typescript/docs/models/errors/internalservererrorcode.md new file mode 100644 index 00000000..62dac56e --- /dev/null +++ b/typescript/docs/models/errors/internalservererrorcode.md @@ -0,0 +1,10 @@ +# InternalServerErrorCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `InternalServerError` | internal_server_error | \ No newline at end of file diff --git a/typescript/docs/models/errors/internalservererrorerror.md b/typescript/docs/models/errors/internalservererrorerror.md new file mode 100644 index 00000000..3568e6de --- /dev/null +++ b/typescript/docs/models/errors/internalservererrorerror.md @@ -0,0 +1,10 @@ +# InternalServerErrorError + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `code` | [errors.InternalServerErrorCode](../../models/errors/internalservererrorcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | internal_server_error | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#internal_server_error | \ No newline at end of file diff --git a/typescript/docs/models/errors/inviteexpired.md b/typescript/docs/models/errors/inviteexpired.md new file mode 100644 index 00000000..ff6b95da --- /dev/null +++ b/typescript/docs/models/errors/inviteexpired.md @@ -0,0 +1,10 @@ +# InviteExpired + +This response is sent when the requested content has been permanently deleted from server, with no forwarding address. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `error` | [errors.InviteExpiredError](../../models/errors/inviteexpirederror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/inviteexpiredcode.md b/typescript/docs/models/errors/inviteexpiredcode.md new file mode 100644 index 00000000..6b3fed26 --- /dev/null +++ b/typescript/docs/models/errors/inviteexpiredcode.md @@ -0,0 +1,10 @@ +# InviteExpiredCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `InviteExpired` | invite_expired | \ No newline at end of file diff --git a/typescript/docs/models/errors/inviteexpirederror.md b/typescript/docs/models/errors/inviteexpirederror.md new file mode 100644 index 00000000..31f13821 --- /dev/null +++ b/typescript/docs/models/errors/inviteexpirederror.md @@ -0,0 +1,10 @@ +# InviteExpiredError + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `code` | [errors.InviteExpiredCode](../../models/errors/inviteexpiredcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | invite_expired | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#invite_expired | \ No newline at end of file diff --git a/typescript/docs/models/errors/notfound.md b/typescript/docs/models/errors/notfound.md new file mode 100644 index 00000000..6d228baa --- /dev/null +++ b/typescript/docs/models/errors/notfound.md @@ -0,0 +1,10 @@ +# NotFound + +The server cannot find the requested resource. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `error` | [errors.NotFoundError](../../models/errors/notfounderror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/notfoundcode.md b/typescript/docs/models/errors/notfoundcode.md new file mode 100644 index 00000000..f30e73df --- /dev/null +++ b/typescript/docs/models/errors/notfoundcode.md @@ -0,0 +1,10 @@ +# NotFoundCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `NotFound` | not_found | \ No newline at end of file diff --git a/typescript/docs/models/errors/notfounderror.md b/typescript/docs/models/errors/notfounderror.md new file mode 100644 index 00000000..340439da --- /dev/null +++ b/typescript/docs/models/errors/notfounderror.md @@ -0,0 +1,10 @@ +# NotFoundError + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `code` | [errors.NotFoundCode](../../models/errors/notfoundcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | not_found | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#not_found | \ No newline at end of file diff --git a/typescript/docs/models/errors/ratelimitexceeded.md b/typescript/docs/models/errors/ratelimitexceeded.md new file mode 100644 index 00000000..dcbf2f8e --- /dev/null +++ b/typescript/docs/models/errors/ratelimitexceeded.md @@ -0,0 +1,10 @@ +# RateLimitExceeded + +The user has sent too many requests in a given amount of time ("rate limiting") + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `error` | [errors.RateLimitExceededError](../../models/errors/ratelimitexceedederror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/ratelimitexceededcode.md b/typescript/docs/models/errors/ratelimitexceededcode.md new file mode 100644 index 00000000..fafbd54d --- /dev/null +++ b/typescript/docs/models/errors/ratelimitexceededcode.md @@ -0,0 +1,10 @@ +# RateLimitExceededCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `RateLimitExceeded` | rate_limit_exceeded | \ No newline at end of file diff --git a/typescript/docs/models/errors/ratelimitexceedederror.md b/typescript/docs/models/errors/ratelimitexceedederror.md new file mode 100644 index 00000000..db875256 --- /dev/null +++ b/typescript/docs/models/errors/ratelimitexceedederror.md @@ -0,0 +1,10 @@ +# RateLimitExceededError + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `code` | [errors.RateLimitExceededCode](../../models/errors/ratelimitexceededcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | rate_limit_exceeded | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#rate_limit_exceeded | \ No newline at end of file diff --git a/typescript/docs/models/errors/unauthorized.md b/typescript/docs/models/errors/unauthorized.md new file mode 100644 index 00000000..73b3e0a9 --- /dev/null +++ b/typescript/docs/models/errors/unauthorized.md @@ -0,0 +1,10 @@ +# Unauthorized + +Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `error` | [errors.UnauthorizedError](../../models/errors/unauthorizederror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/unauthorizedcode.md b/typescript/docs/models/errors/unauthorizedcode.md new file mode 100644 index 00000000..91777d32 --- /dev/null +++ b/typescript/docs/models/errors/unauthorizedcode.md @@ -0,0 +1,10 @@ +# UnauthorizedCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `Unauthorized` | unauthorized | \ No newline at end of file diff --git a/typescript/docs/models/errors/unauthorizederror.md b/typescript/docs/models/errors/unauthorizederror.md new file mode 100644 index 00000000..705b175a --- /dev/null +++ b/typescript/docs/models/errors/unauthorizederror.md @@ -0,0 +1,10 @@ +# UnauthorizedError + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `code` | [errors.UnauthorizedCode](../../models/errors/unauthorizedcode.md) | :heavy_check_mark: | A short code indicating the error code returned. | unauthorized | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#unauthorized | \ No newline at end of file diff --git a/typescript/docs/models/errors/unprocessableentity.md b/typescript/docs/models/errors/unprocessableentity.md new file mode 100644 index 00000000..eeec3f34 --- /dev/null +++ b/typescript/docs/models/errors/unprocessableentity.md @@ -0,0 +1,10 @@ +# UnprocessableEntity + +The request was well-formed but was unable to be followed due to semantic errors. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `error` | [errors.UnprocessableEntityError](../../models/errors/unprocessableentityerror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/errors/unprocessableentitycode.md b/typescript/docs/models/errors/unprocessableentitycode.md new file mode 100644 index 00000000..5076e55a --- /dev/null +++ b/typescript/docs/models/errors/unprocessableentitycode.md @@ -0,0 +1,10 @@ +# UnprocessableEntityCode + +A short code indicating the error code returned. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `UnprocessableEntity` | unprocessable_entity | \ No newline at end of file diff --git a/typescript/docs/models/errors/unprocessableentityerror.md b/typescript/docs/models/errors/unprocessableentityerror.md new file mode 100644 index 00000000..40c7ee9d --- /dev/null +++ b/typescript/docs/models/errors/unprocessableentityerror.md @@ -0,0 +1,10 @@ +# UnprocessableEntityError + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `code` | [errors.UnprocessableEntityCode](../../models/errors/unprocessableentitycode.md) | :heavy_check_mark: | A short code indicating the error code returned. | unprocessable_entity | +| `message` | *string* | :heavy_check_mark: | A human readable explanation of what went wrong. | The requested resource was not found. | +| `docUrl` | *string* | :heavy_minus_sign: | A link to our documentation with more details about this error code | https://dub.co/docs/api-reference/errors#unprocessable_entity | \ No newline at end of file diff --git a/typescript/docs/models/operations/bulkcreatelinksrequest.md b/typescript/docs/models/operations/bulkcreatelinksrequest.md new file mode 100644 index 00000000..9169fb57 --- /dev/null +++ b/typescript/docs/models/operations/bulkcreatelinksrequest.md @@ -0,0 +1,9 @@ +# BulkCreateLinksRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace to create the link for. | +| `requestBody` | [operations.RequestBody](../../models/operations/requestbody.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/operations/bulkcreatelinkstagids.md b/typescript/docs/models/operations/bulkcreatelinkstagids.md new file mode 100644 index 00000000..4a272901 --- /dev/null +++ b/typescript/docs/models/operations/bulkcreatelinkstagids.md @@ -0,0 +1,4 @@ +# BulkCreateLinksTagIds + +The unique IDs of the tags assigned to the short link. + diff --git a/typescript/docs/models/operations/color.md b/typescript/docs/models/operations/color.md new file mode 100644 index 00000000..0e2f0fb1 --- /dev/null +++ b/typescript/docs/models/operations/color.md @@ -0,0 +1,16 @@ +# Color + +The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, pink, brown. + + +## Values + +| Name | Value | +| -------- | -------- | +| `Red` | red | +| `Yellow` | yellow | +| `Green` | green | +| `Blue` | blue | +| `Purple` | purple | +| `Pink` | pink | +| `Brown` | brown | \ No newline at end of file diff --git a/typescript/docs/models/operations/country.md b/typescript/docs/models/operations/country.md new file mode 100644 index 00000000..e20d6029 --- /dev/null +++ b/typescript/docs/models/operations/country.md @@ -0,0 +1,259 @@ +# Country + +The country to retrieve analytics for. + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/createlinkrequest.md b/typescript/docs/models/operations/createlinkrequest.md new file mode 100644 index 00000000..5bcfa414 --- /dev/null +++ b/typescript/docs/models/operations/createlinkrequest.md @@ -0,0 +1,9 @@ +# CreateLinkRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace to create the link for. | +| `requestBody` | [operations.CreateLinkRequestBody](../../models/operations/createlinkrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/operations/createlinkrequestbody.md b/typescript/docs/models/operations/createlinkrequestbody.md new file mode 100644 index 00000000..15c9bba4 --- /dev/null +++ b/typescript/docs/models/operations/createlinkrequestbody.md @@ -0,0 +1,27 @@ +# CreateLinkRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). | +| `key` | *string* | :heavy_minus_sign: | The short link slug. If not provided, a random 7-character slug will be generated. | +| `prefix` | *string* | :heavy_minus_sign: | The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. | +| `url` | *string* | :heavy_check_mark: | The destination URL of the short link. | +| `archived` | *boolean* | :heavy_minus_sign: | Whether the short link is archived. | +| `expiresAt` | *string* | :heavy_minus_sign: | The date and time when the short link will expire at. | +| `expiredUrl` | *string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | +| `password` | *string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | +| `proxy` | *boolean* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | +| `title` | *string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `description` | *string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `image` | *string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `rewrite` | *boolean* | :heavy_minus_sign: | Whether the short link uses link cloaking. | +| `ios` | *string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | +| `android` | *string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | +| `geo` | Record | :heavy_minus_sign: | Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. | +| `publicStats` | *boolean* | :heavy_minus_sign: | Whether the short link's stats are publicly accessible. | +| ~~`tagId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

[DEPRECATED] (use tagIds instead): The unique ID of the tag assigned to the short link. | +| `tagIds` | *operations.TagIds* | :heavy_minus_sign: | The unique IDs of the tags assigned to the short link. | +| `comments` | *string* | :heavy_minus_sign: | The comments for the short link. | \ No newline at end of file diff --git a/typescript/docs/models/operations/createtagrequest.md b/typescript/docs/models/operations/createtagrequest.md new file mode 100644 index 00000000..275c1ede --- /dev/null +++ b/typescript/docs/models/operations/createtagrequest.md @@ -0,0 +1,9 @@ +# CreateTagRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace to create the tag for. | +| `requestBody` | [operations.CreateTagRequestBody](../../models/operations/createtagrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/operations/createtagrequestbody.md b/typescript/docs/models/operations/createtagrequestbody.md new file mode 100644 index 00000000..79581179 --- /dev/null +++ b/typescript/docs/models/operations/createtagrequestbody.md @@ -0,0 +1,9 @@ +# CreateTagRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `tag` | *string* | :heavy_check_mark: | The name of the tag to create. | +| `color` | [operations.Color](../../models/operations/color.md) | :heavy_minus_sign: | The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, pink, brown. | \ No newline at end of file diff --git a/typescript/docs/models/operations/createworkspacerequestbody.md b/typescript/docs/models/operations/createworkspacerequestbody.md new file mode 100644 index 00000000..e4d56514 --- /dev/null +++ b/typescript/docs/models/operations/createworkspacerequestbody.md @@ -0,0 +1,10 @@ +# CreateWorkspaceRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `name` | *string* | :heavy_check_mark: | N/A | +| `slug` | *string* | :heavy_check_mark: | N/A | +| `domain` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/operations/deletelinkrequest.md b/typescript/docs/models/operations/deletelinkrequest.md new file mode 100644 index 00000000..bed54dd3 --- /dev/null +++ b/typescript/docs/models/operations/deletelinkrequest.md @@ -0,0 +1,9 @@ +# DeleteLinkRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `linkId` | *string* | :heavy_check_mark: | The id of the link to delete. You can get this via the `getLinkInfo` endpoint. | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | \ No newline at end of file diff --git a/typescript/docs/models/operations/deletelinkresponsebody.md b/typescript/docs/models/operations/deletelinkresponsebody.md new file mode 100644 index 00000000..a0b56d8c --- /dev/null +++ b/typescript/docs/models/operations/deletelinkresponsebody.md @@ -0,0 +1,10 @@ +# DeleteLinkResponseBody + +The deleted link + + +## Fields + +| Field | Type | Required | Description | +| ------------------- | ------------------- | ------------------- | ------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the link. | \ No newline at end of file diff --git a/typescript/docs/models/operations/editlinkrequest.md b/typescript/docs/models/operations/editlinkrequest.md new file mode 100644 index 00000000..308a9700 --- /dev/null +++ b/typescript/docs/models/operations/editlinkrequest.md @@ -0,0 +1,10 @@ +# EditLinkRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `linkId` | *string* | :heavy_check_mark: | The id of the link to edit. You can get this via the `getLinkInfo` endpoint. | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `requestBody` | [operations.EditLinkRequestBody](../../models/operations/editlinkrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/typescript/docs/models/operations/editlinkrequestbody.md b/typescript/docs/models/operations/editlinkrequestbody.md new file mode 100644 index 00000000..0f3cedff --- /dev/null +++ b/typescript/docs/models/operations/editlinkrequestbody.md @@ -0,0 +1,27 @@ +# EditLinkRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). | +| `key` | *string* | :heavy_minus_sign: | The short link slug. If not provided, a random 7-character slug will be generated. | +| `prefix` | *string* | :heavy_minus_sign: | The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. | +| `url` | *string* | :heavy_check_mark: | The destination URL of the short link. | +| `archived` | *boolean* | :heavy_minus_sign: | Whether the short link is archived. | +| `expiresAt` | *string* | :heavy_minus_sign: | The date and time when the short link will expire at. | +| `expiredUrl` | *string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | +| `password` | *string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | +| `proxy` | *boolean* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | +| `title` | *string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `description` | *string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `image` | *string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `rewrite` | *boolean* | :heavy_minus_sign: | Whether the short link uses link cloaking. | +| `ios` | *string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | +| `android` | *string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | +| `geo` | Record | :heavy_minus_sign: | Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. | +| `publicStats` | *boolean* | :heavy_minus_sign: | Whether the short link's stats are publicly accessible. | +| ~~`tagId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

[DEPRECATED] (use tagIds instead): The unique ID of the tag assigned to the short link. | +| `tagIds` | *operations.EditLinkTagIds* | :heavy_minus_sign: | The unique IDs of the tags assigned to the short link. | +| `comments` | *string* | :heavy_minus_sign: | The comments for the short link. | \ No newline at end of file diff --git a/typescript/docs/models/operations/editlinktagids.md b/typescript/docs/models/operations/editlinktagids.md new file mode 100644 index 00000000..e7df8034 --- /dev/null +++ b/typescript/docs/models/operations/editlinktagids.md @@ -0,0 +1,4 @@ +# EditLinkTagIds + +The unique IDs of the tags assigned to the short link. + diff --git a/typescript/docs/models/operations/getbrowseranalyticsqueryparamcountry.md b/typescript/docs/models/operations/getbrowseranalyticsqueryparamcountry.md new file mode 100644 index 00000000..38bafd65 --- /dev/null +++ b/typescript/docs/models/operations/getbrowseranalyticsqueryparamcountry.md @@ -0,0 +1,259 @@ +# GetBrowserAnalyticsQueryParamCountry + +The country to retrieve analytics for. + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/getbrowseranalyticsqueryparaminterval.md b/typescript/docs/models/operations/getbrowseranalyticsqueryparaminterval.md new file mode 100644 index 00000000..1fc1ba87 --- /dev/null +++ b/typescript/docs/models/operations/getbrowseranalyticsqueryparaminterval.md @@ -0,0 +1,15 @@ +# GetBrowserAnalyticsQueryParamInterval + +The interval to retrieve analytics for. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `Oneh` | 1h | +| `TwentyFourh` | 24h | +| `Sevend` | 7d | +| `Thirtyd` | 30d | +| `Ninetyd` | 90d | +| `All` | all | \ No newline at end of file diff --git a/typescript/docs/models/operations/getbrowseranalyticsrequest.md b/typescript/docs/models/operations/getbrowseranalyticsrequest.md new file mode 100644 index 00000000..62ce710e --- /dev/null +++ b/typescript/docs/models/operations/getbrowseranalyticsrequest.md @@ -0,0 +1,20 @@ +# GetBrowserAnalyticsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. | +| `key` | *string* | :heavy_minus_sign: | The short link slug. | +| `interval` | [operations.GetBrowserAnalyticsQueryParamInterval](../../models/operations/getbrowseranalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `country` | [operations.GetBrowserAnalyticsQueryParamCountry](../../models/operations/getbrowseranalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | +| `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | +| `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | +| `browser` | *string* | :heavy_minus_sign: | The browser to retrieve analytics for. | +| `os` | *string* | :heavy_minus_sign: | The OS to retrieve analytics for. | +| `referer` | *string* | :heavy_minus_sign: | The referer to retrieve analytics for. | +| `url` | *string* | :heavy_minus_sign: | The URL to retrieve analytics for. | +| `excludeRoot` | *boolean* | :heavy_minus_sign: | Whether to exclude the root link from the response. | +| `tagId` | *string* | :heavy_minus_sign: | The tag ID to retrieve analytics for. | \ No newline at end of file diff --git a/typescript/docs/models/operations/getbrowseranalyticsresponsebody.md b/typescript/docs/models/operations/getbrowseranalyticsresponsebody.md new file mode 100644 index 00000000..10213f93 --- /dev/null +++ b/typescript/docs/models/operations/getbrowseranalyticsresponsebody.md @@ -0,0 +1,9 @@ +# GetBrowserAnalyticsResponseBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `browser` | *string* | :heavy_check_mark: | The name of the browser | +| `clicks` | *number* | :heavy_check_mark: | The number of clicks from this browser | \ No newline at end of file diff --git a/typescript/docs/models/operations/getcityanalyticscountry.md b/typescript/docs/models/operations/getcityanalyticscountry.md new file mode 100644 index 00000000..484e915a --- /dev/null +++ b/typescript/docs/models/operations/getcityanalyticscountry.md @@ -0,0 +1,259 @@ +# GetCityAnalyticsCountry + +The 2-letter country code of the city: https://d.to/geo + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/getcityanalyticsqueryparamcountry.md b/typescript/docs/models/operations/getcityanalyticsqueryparamcountry.md new file mode 100644 index 00000000..d72bcfb3 --- /dev/null +++ b/typescript/docs/models/operations/getcityanalyticsqueryparamcountry.md @@ -0,0 +1,259 @@ +# GetCityAnalyticsQueryParamCountry + +The country to retrieve analytics for. + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/getcityanalyticsqueryparaminterval.md b/typescript/docs/models/operations/getcityanalyticsqueryparaminterval.md new file mode 100644 index 00000000..b8064986 --- /dev/null +++ b/typescript/docs/models/operations/getcityanalyticsqueryparaminterval.md @@ -0,0 +1,15 @@ +# GetCityAnalyticsQueryParamInterval + +The interval to retrieve analytics for. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `Oneh` | 1h | +| `TwentyFourh` | 24h | +| `Sevend` | 7d | +| `Thirtyd` | 30d | +| `Ninetyd` | 90d | +| `All` | all | \ No newline at end of file diff --git a/typescript/docs/models/operations/getcityanalyticsrequest.md b/typescript/docs/models/operations/getcityanalyticsrequest.md new file mode 100644 index 00000000..ca987c66 --- /dev/null +++ b/typescript/docs/models/operations/getcityanalyticsrequest.md @@ -0,0 +1,20 @@ +# GetCityAnalyticsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. | +| `key` | *string* | :heavy_minus_sign: | The short link slug. | +| `interval` | [operations.GetCityAnalyticsQueryParamInterval](../../models/operations/getcityanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `country` | [operations.GetCityAnalyticsQueryParamCountry](../../models/operations/getcityanalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | +| `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | +| `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | +| `browser` | *string* | :heavy_minus_sign: | The browser to retrieve analytics for. | +| `os` | *string* | :heavy_minus_sign: | The OS to retrieve analytics for. | +| `referer` | *string* | :heavy_minus_sign: | The referer to retrieve analytics for. | +| `url` | *string* | :heavy_minus_sign: | The URL to retrieve analytics for. | +| `excludeRoot` | *boolean* | :heavy_minus_sign: | Whether to exclude the root link from the response. | +| `tagId` | *string* | :heavy_minus_sign: | The tag ID to retrieve analytics for. | \ No newline at end of file diff --git a/typescript/docs/models/operations/getcityanalyticsresponsebody.md b/typescript/docs/models/operations/getcityanalyticsresponsebody.md new file mode 100644 index 00000000..c0ee1756 --- /dev/null +++ b/typescript/docs/models/operations/getcityanalyticsresponsebody.md @@ -0,0 +1,10 @@ +# GetCityAnalyticsResponseBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `city` | *string* | :heavy_check_mark: | The name of the city | +| `country` | [operations.GetCityAnalyticsCountry](../../models/operations/getcityanalyticscountry.md) | :heavy_check_mark: | The 2-letter country code of the city: https://d.to/geo | +| `clicks` | *number* | :heavy_check_mark: | The number of clicks from this city | \ No newline at end of file diff --git a/typescript/docs/models/operations/getclicksanalyticsrequest.md b/typescript/docs/models/operations/getclicksanalyticsrequest.md new file mode 100644 index 00000000..d93e32ec --- /dev/null +++ b/typescript/docs/models/operations/getclicksanalyticsrequest.md @@ -0,0 +1,20 @@ +# GetClicksAnalyticsRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. | +| `key` | *string* | :heavy_minus_sign: | The short link slug. | +| `interval` | [operations.Interval](../../models/operations/interval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `country` | [operations.Country](../../models/operations/country.md) | :heavy_minus_sign: | The country to retrieve analytics for. | +| `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | +| `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | +| `browser` | *string* | :heavy_minus_sign: | The browser to retrieve analytics for. | +| `os` | *string* | :heavy_minus_sign: | The OS to retrieve analytics for. | +| `referer` | *string* | :heavy_minus_sign: | The referer to retrieve analytics for. | +| `url` | *string* | :heavy_minus_sign: | The URL to retrieve analytics for. | +| `excludeRoot` | *boolean* | :heavy_minus_sign: | Whether to exclude the root link from the response. | +| `tagId` | *string* | :heavy_minus_sign: | The tag ID to retrieve analytics for. | \ No newline at end of file diff --git a/typescript/docs/models/operations/getcountryanalyticscountry.md b/typescript/docs/models/operations/getcountryanalyticscountry.md new file mode 100644 index 00000000..0c278a16 --- /dev/null +++ b/typescript/docs/models/operations/getcountryanalyticscountry.md @@ -0,0 +1,259 @@ +# GetCountryAnalyticsCountry + +The 2-letter country code: https://d.to/geo + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/getcountryanalyticsqueryparamcountry.md b/typescript/docs/models/operations/getcountryanalyticsqueryparamcountry.md new file mode 100644 index 00000000..ff86dca1 --- /dev/null +++ b/typescript/docs/models/operations/getcountryanalyticsqueryparamcountry.md @@ -0,0 +1,259 @@ +# GetCountryAnalyticsQueryParamCountry + +The country to retrieve analytics for. + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/getcountryanalyticsqueryparaminterval.md b/typescript/docs/models/operations/getcountryanalyticsqueryparaminterval.md new file mode 100644 index 00000000..7a4a717e --- /dev/null +++ b/typescript/docs/models/operations/getcountryanalyticsqueryparaminterval.md @@ -0,0 +1,15 @@ +# GetCountryAnalyticsQueryParamInterval + +The interval to retrieve analytics for. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `Oneh` | 1h | +| `TwentyFourh` | 24h | +| `Sevend` | 7d | +| `Thirtyd` | 30d | +| `Ninetyd` | 90d | +| `All` | all | \ No newline at end of file diff --git a/typescript/docs/models/operations/getcountryanalyticsrequest.md b/typescript/docs/models/operations/getcountryanalyticsrequest.md new file mode 100644 index 00000000..fe6c4c9a --- /dev/null +++ b/typescript/docs/models/operations/getcountryanalyticsrequest.md @@ -0,0 +1,20 @@ +# GetCountryAnalyticsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. | +| `key` | *string* | :heavy_minus_sign: | The short link slug. | +| `interval` | [operations.GetCountryAnalyticsQueryParamInterval](../../models/operations/getcountryanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `country` | [operations.GetCountryAnalyticsQueryParamCountry](../../models/operations/getcountryanalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | +| `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | +| `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | +| `browser` | *string* | :heavy_minus_sign: | The browser to retrieve analytics for. | +| `os` | *string* | :heavy_minus_sign: | The OS to retrieve analytics for. | +| `referer` | *string* | :heavy_minus_sign: | The referer to retrieve analytics for. | +| `url` | *string* | :heavy_minus_sign: | The URL to retrieve analytics for. | +| `excludeRoot` | *boolean* | :heavy_minus_sign: | Whether to exclude the root link from the response. | +| `tagId` | *string* | :heavy_minus_sign: | The tag ID to retrieve analytics for. | \ No newline at end of file diff --git a/typescript/docs/models/operations/getcountryanalyticsresponsebody.md b/typescript/docs/models/operations/getcountryanalyticsresponsebody.md new file mode 100644 index 00000000..701ad760 --- /dev/null +++ b/typescript/docs/models/operations/getcountryanalyticsresponsebody.md @@ -0,0 +1,9 @@ +# GetCountryAnalyticsResponseBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `country` | [operations.GetCountryAnalyticsCountry](../../models/operations/getcountryanalyticscountry.md) | :heavy_check_mark: | The 2-letter country code: https://d.to/geo | +| `clicks` | *number* | :heavy_check_mark: | The number of clicks from this country | \ No newline at end of file diff --git a/typescript/docs/models/operations/getdeviceanalyticsqueryparamcountry.md b/typescript/docs/models/operations/getdeviceanalyticsqueryparamcountry.md new file mode 100644 index 00000000..b38191d1 --- /dev/null +++ b/typescript/docs/models/operations/getdeviceanalyticsqueryparamcountry.md @@ -0,0 +1,259 @@ +# GetDeviceAnalyticsQueryParamCountry + +The country to retrieve analytics for. + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/getdeviceanalyticsqueryparaminterval.md b/typescript/docs/models/operations/getdeviceanalyticsqueryparaminterval.md new file mode 100644 index 00000000..79b56f32 --- /dev/null +++ b/typescript/docs/models/operations/getdeviceanalyticsqueryparaminterval.md @@ -0,0 +1,15 @@ +# GetDeviceAnalyticsQueryParamInterval + +The interval to retrieve analytics for. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `Oneh` | 1h | +| `TwentyFourh` | 24h | +| `Sevend` | 7d | +| `Thirtyd` | 30d | +| `Ninetyd` | 90d | +| `All` | all | \ No newline at end of file diff --git a/typescript/docs/models/operations/getdeviceanalyticsrequest.md b/typescript/docs/models/operations/getdeviceanalyticsrequest.md new file mode 100644 index 00000000..e5410b55 --- /dev/null +++ b/typescript/docs/models/operations/getdeviceanalyticsrequest.md @@ -0,0 +1,20 @@ +# GetDeviceAnalyticsRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. | +| `key` | *string* | :heavy_minus_sign: | The short link slug. | +| `interval` | [operations.GetDeviceAnalyticsQueryParamInterval](../../models/operations/getdeviceanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `country` | [operations.GetDeviceAnalyticsQueryParamCountry](../../models/operations/getdeviceanalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | +| `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | +| `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | +| `browser` | *string* | :heavy_minus_sign: | The browser to retrieve analytics for. | +| `os` | *string* | :heavy_minus_sign: | The OS to retrieve analytics for. | +| `referer` | *string* | :heavy_minus_sign: | The referer to retrieve analytics for. | +| `url` | *string* | :heavy_minus_sign: | The URL to retrieve analytics for. | +| `excludeRoot` | *boolean* | :heavy_minus_sign: | Whether to exclude the root link from the response. | +| `tagId` | *string* | :heavy_minus_sign: | The tag ID to retrieve analytics for. | \ No newline at end of file diff --git a/typescript/docs/models/operations/getdeviceanalyticsresponsebody.md b/typescript/docs/models/operations/getdeviceanalyticsresponsebody.md new file mode 100644 index 00000000..8ef18438 --- /dev/null +++ b/typescript/docs/models/operations/getdeviceanalyticsresponsebody.md @@ -0,0 +1,9 @@ +# GetDeviceAnalyticsResponseBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `device` | *string* | :heavy_check_mark: | The name of the device | +| `clicks` | *number* | :heavy_check_mark: | The number of clicks from this device | \ No newline at end of file diff --git a/typescript/docs/models/operations/getlinkinforequest.md b/typescript/docs/models/operations/getlinkinforequest.md new file mode 100644 index 00000000..7f0cbb23 --- /dev/null +++ b/typescript/docs/models/operations/getlinkinforequest.md @@ -0,0 +1,10 @@ +# GetLinkInfoRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_check_mark: | The domain of the link to retrieve. E.g. for `d.to/github`, the domain is `d.to`. | +| `key` | *string* | :heavy_check_mark: | The key of the link to retrieve. E.g. for `d.to/github`, the key is `github`. | \ No newline at end of file diff --git a/typescript/docs/models/operations/getlinkscountqueryparamtagids.md b/typescript/docs/models/operations/getlinkscountqueryparamtagids.md new file mode 100644 index 00000000..7e702083 --- /dev/null +++ b/typescript/docs/models/operations/getlinkscountqueryparamtagids.md @@ -0,0 +1,4 @@ +# GetLinksCountQueryParamTagIds + +The tag IDs to filter the links by. + diff --git a/typescript/docs/models/operations/getlinkscountrequest.md b/typescript/docs/models/operations/getlinkscountrequest.md new file mode 100644 index 00000000..19490abc --- /dev/null +++ b/typescript/docs/models/operations/getlinkscountrequest.md @@ -0,0 +1,16 @@ +# GetLinksCountRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned. | +| `tagId` | *string* | :heavy_minus_sign: | [DEPRECATED] (use tagIds instead): The tag ID to filter the links by. | +| `tagIds` | *operations.GetLinksCountQueryParamTagIds* | :heavy_minus_sign: | The tag IDs to filter the links by. | +| `search` | *string* | :heavy_minus_sign: | The search term to filter the links by. The search term will be matched against the short link slug and the destination url. | +| `userId` | *string* | :heavy_minus_sign: | The user ID to filter the links by. | +| `showArchived` | *boolean* | :heavy_minus_sign: | Whether to include archived links in the response. Defaults to `false` if not provided. | +| `withTags` | *boolean* | :heavy_minus_sign: | Whether to include tags in the response. Defaults to `false` if not provided. | +| `groupBy` | *operations.GroupBy* | :heavy_minus_sign: | The field to group the links by. | \ No newline at end of file diff --git a/typescript/docs/models/operations/getlinksrequest.md b/typescript/docs/models/operations/getlinksrequest.md new file mode 100644 index 00000000..7d004537 --- /dev/null +++ b/typescript/docs/models/operations/getlinksrequest.md @@ -0,0 +1,17 @@ +# GetLinksRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned. | +| `tagId` | *string* | :heavy_minus_sign: | [DEPRECATED] (use tagIds instead): The tag ID to filter the links by. | +| `tagIds` | *operations.QueryParamTagIds* | :heavy_minus_sign: | The tag IDs to filter the links by. | +| `search` | *string* | :heavy_minus_sign: | The search term to filter the links by. The search term will be matched against the short link slug and the destination url. | +| `userId` | *string* | :heavy_minus_sign: | The user ID to filter the links by. | +| `showArchived` | *boolean* | :heavy_minus_sign: | Whether to include archived links in the response. Defaults to `false` if not provided. | +| `withTags` | *boolean* | :heavy_minus_sign: | Whether to include tags in the response. Defaults to `false` if not provided. | +| `sort` | [operations.Sort](../../models/operations/sort.md) | :heavy_minus_sign: | The field to sort the links by. The default is `createdAt`, and sort order is always descending. | +| `page` | *number* | :heavy_minus_sign: | The page number for pagination (each page contains 100 links). | \ No newline at end of file diff --git a/typescript/docs/models/operations/getosanalyticsqueryparamcountry.md b/typescript/docs/models/operations/getosanalyticsqueryparamcountry.md new file mode 100644 index 00000000..7d2376ff --- /dev/null +++ b/typescript/docs/models/operations/getosanalyticsqueryparamcountry.md @@ -0,0 +1,259 @@ +# GetOSAnalyticsQueryParamCountry + +The country to retrieve analytics for. + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/getosanalyticsqueryparaminterval.md b/typescript/docs/models/operations/getosanalyticsqueryparaminterval.md new file mode 100644 index 00000000..1bb5bdae --- /dev/null +++ b/typescript/docs/models/operations/getosanalyticsqueryparaminterval.md @@ -0,0 +1,15 @@ +# GetOSAnalyticsQueryParamInterval + +The interval to retrieve analytics for. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `Oneh` | 1h | +| `TwentyFourh` | 24h | +| `Sevend` | 7d | +| `Thirtyd` | 30d | +| `Ninetyd` | 90d | +| `All` | all | \ No newline at end of file diff --git a/typescript/docs/models/operations/getosanalyticsrequest.md b/typescript/docs/models/operations/getosanalyticsrequest.md new file mode 100644 index 00000000..d3fc25cc --- /dev/null +++ b/typescript/docs/models/operations/getosanalyticsrequest.md @@ -0,0 +1,20 @@ +# GetOSAnalyticsRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. | +| `key` | *string* | :heavy_minus_sign: | The short link slug. | +| `interval` | [operations.GetOSAnalyticsQueryParamInterval](../../models/operations/getosanalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `country` | [operations.GetOSAnalyticsQueryParamCountry](../../models/operations/getosanalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | +| `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | +| `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | +| `browser` | *string* | :heavy_minus_sign: | The browser to retrieve analytics for. | +| `os` | *string* | :heavy_minus_sign: | The OS to retrieve analytics for. | +| `referer` | *string* | :heavy_minus_sign: | The referer to retrieve analytics for. | +| `url` | *string* | :heavy_minus_sign: | The URL to retrieve analytics for. | +| `excludeRoot` | *boolean* | :heavy_minus_sign: | Whether to exclude the root link from the response. | +| `tagId` | *string* | :heavy_minus_sign: | The tag ID to retrieve analytics for. | \ No newline at end of file diff --git a/typescript/docs/models/operations/getosanalyticsresponsebody.md b/typescript/docs/models/operations/getosanalyticsresponsebody.md new file mode 100644 index 00000000..e3f8071a --- /dev/null +++ b/typescript/docs/models/operations/getosanalyticsresponsebody.md @@ -0,0 +1,9 @@ +# GetOSAnalyticsResponseBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `os` | *string* | :heavy_check_mark: | The name of the OS | +| `clicks` | *number* | :heavy_check_mark: | The number of clicks from this OS | \ No newline at end of file diff --git a/typescript/docs/models/operations/getqrcoderequest.md b/typescript/docs/models/operations/getqrcoderequest.md new file mode 100644 index 00000000..30c3ee33 --- /dev/null +++ b/typescript/docs/models/operations/getqrcoderequest.md @@ -0,0 +1,13 @@ +# GetQRCodeRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `url` | *string* | :heavy_minus_sign: | The URL to generate a QR code for. Defaults to `https://dub.co` if not provided. | +| `size` | *number* | :heavy_minus_sign: | The size of the QR code in pixels. Defaults to `600` if not provided. | +| `level` | [operations.Level](../../models/operations/level.md) | :heavy_minus_sign: | The level of error correction to use for the QR code. Defaults to `L` if not provided. | +| `fgColor` | *string* | :heavy_minus_sign: | The foreground color of the QR code in hex format. Defaults to `#000000` if not provided. | +| `bgColor` | *string* | :heavy_minus_sign: | The background color of the QR code in hex format. Defaults to `#ffffff` if not provided. | +| `includeMargin` | *boolean* | :heavy_minus_sign: | Whether to include a margin around the QR code. Defaults to `false` if not provided. | \ No newline at end of file diff --git a/typescript/docs/models/operations/getrefereranalyticsqueryparamcountry.md b/typescript/docs/models/operations/getrefereranalyticsqueryparamcountry.md new file mode 100644 index 00000000..8f258126 --- /dev/null +++ b/typescript/docs/models/operations/getrefereranalyticsqueryparamcountry.md @@ -0,0 +1,259 @@ +# GetRefererAnalyticsQueryParamCountry + +The country to retrieve analytics for. + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/getrefereranalyticsqueryparaminterval.md b/typescript/docs/models/operations/getrefereranalyticsqueryparaminterval.md new file mode 100644 index 00000000..6fbafd19 --- /dev/null +++ b/typescript/docs/models/operations/getrefereranalyticsqueryparaminterval.md @@ -0,0 +1,15 @@ +# GetRefererAnalyticsQueryParamInterval + +The interval to retrieve analytics for. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `Oneh` | 1h | +| `TwentyFourh` | 24h | +| `Sevend` | 7d | +| `Thirtyd` | 30d | +| `Ninetyd` | 90d | +| `All` | all | \ No newline at end of file diff --git a/typescript/docs/models/operations/getrefereranalyticsrequest.md b/typescript/docs/models/operations/getrefereranalyticsrequest.md new file mode 100644 index 00000000..d32b8b04 --- /dev/null +++ b/typescript/docs/models/operations/getrefereranalyticsrequest.md @@ -0,0 +1,20 @@ +# GetRefererAnalyticsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. | +| `key` | *string* | :heavy_minus_sign: | The short link slug. | +| `interval` | [operations.GetRefererAnalyticsQueryParamInterval](../../models/operations/getrefereranalyticsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `country` | [operations.GetRefererAnalyticsQueryParamCountry](../../models/operations/getrefereranalyticsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | +| `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | +| `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | +| `browser` | *string* | :heavy_minus_sign: | The browser to retrieve analytics for. | +| `os` | *string* | :heavy_minus_sign: | The OS to retrieve analytics for. | +| `referer` | *string* | :heavy_minus_sign: | The referer to retrieve analytics for. | +| `url` | *string* | :heavy_minus_sign: | The URL to retrieve analytics for. | +| `excludeRoot` | *boolean* | :heavy_minus_sign: | Whether to exclude the root link from the response. | +| `tagId` | *string* | :heavy_minus_sign: | The tag ID to retrieve analytics for. | \ No newline at end of file diff --git a/typescript/docs/models/operations/getrefereranalyticsresponsebody.md b/typescript/docs/models/operations/getrefereranalyticsresponsebody.md new file mode 100644 index 00000000..181738fa --- /dev/null +++ b/typescript/docs/models/operations/getrefereranalyticsresponsebody.md @@ -0,0 +1,9 @@ +# GetRefererAnalyticsResponseBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `referer` | *string* | :heavy_check_mark: | The name of the referer. If unknown, this will be `(direct)` | +| `clicks` | *number* | :heavy_check_mark: | The number of clicks from this referer | \ No newline at end of file diff --git a/typescript/docs/models/operations/gettagsrequest.md b/typescript/docs/models/operations/gettagsrequest.md new file mode 100644 index 00000000..733b5ff1 --- /dev/null +++ b/typescript/docs/models/operations/gettagsrequest.md @@ -0,0 +1,8 @@ +# GetTagsRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace to retrieve the tags for. | \ No newline at end of file diff --git a/typescript/docs/models/operations/gettimeseriesanalyticsrequest.md b/typescript/docs/models/operations/gettimeseriesanalyticsrequest.md new file mode 100644 index 00000000..4f1d7506 --- /dev/null +++ b/typescript/docs/models/operations/gettimeseriesanalyticsrequest.md @@ -0,0 +1,20 @@ +# GetTimeseriesAnalyticsRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. | +| `key` | *string* | :heavy_minus_sign: | The short link slug. | +| `interval` | [operations.QueryParamInterval](../../models/operations/queryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `country` | [operations.QueryParamCountry](../../models/operations/queryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | +| `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | +| `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | +| `browser` | *string* | :heavy_minus_sign: | The browser to retrieve analytics for. | +| `os` | *string* | :heavy_minus_sign: | The OS to retrieve analytics for. | +| `referer` | *string* | :heavy_minus_sign: | The referer to retrieve analytics for. | +| `url` | *string* | :heavy_minus_sign: | The URL to retrieve analytics for. | +| `excludeRoot` | *boolean* | :heavy_minus_sign: | Whether to exclude the root link from the response. | +| `tagId` | *string* | :heavy_minus_sign: | The tag ID to retrieve analytics for. | \ No newline at end of file diff --git a/typescript/docs/models/operations/gettoplinksqueryparamcountry.md b/typescript/docs/models/operations/gettoplinksqueryparamcountry.md new file mode 100644 index 00000000..3ef47a87 --- /dev/null +++ b/typescript/docs/models/operations/gettoplinksqueryparamcountry.md @@ -0,0 +1,259 @@ +# GetTopLinksQueryParamCountry + +The country to retrieve analytics for. + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/gettoplinksqueryparaminterval.md b/typescript/docs/models/operations/gettoplinksqueryparaminterval.md new file mode 100644 index 00000000..4a160016 --- /dev/null +++ b/typescript/docs/models/operations/gettoplinksqueryparaminterval.md @@ -0,0 +1,15 @@ +# GetTopLinksQueryParamInterval + +The interval to retrieve analytics for. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `Oneh` | 1h | +| `TwentyFourh` | 24h | +| `Sevend` | 7d | +| `Thirtyd` | 30d | +| `Ninetyd` | 90d | +| `All` | all | \ No newline at end of file diff --git a/typescript/docs/models/operations/gettoplinksrequest.md b/typescript/docs/models/operations/gettoplinksrequest.md new file mode 100644 index 00000000..b6827914 --- /dev/null +++ b/typescript/docs/models/operations/gettoplinksrequest.md @@ -0,0 +1,20 @@ +# GetTopLinksRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. | +| `key` | *string* | :heavy_minus_sign: | The short link slug. | +| `interval` | [operations.GetTopLinksQueryParamInterval](../../models/operations/gettoplinksqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `country` | [operations.GetTopLinksQueryParamCountry](../../models/operations/gettoplinksqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | +| `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | +| `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | +| `browser` | *string* | :heavy_minus_sign: | The browser to retrieve analytics for. | +| `os` | *string* | :heavy_minus_sign: | The OS to retrieve analytics for. | +| `referer` | *string* | :heavy_minus_sign: | The referer to retrieve analytics for. | +| `url` | *string* | :heavy_minus_sign: | The URL to retrieve analytics for. | +| `excludeRoot` | *boolean* | :heavy_minus_sign: | Whether to exclude the root link from the response. | +| `tagId` | *string* | :heavy_minus_sign: | The tag ID to retrieve analytics for. | \ No newline at end of file diff --git a/typescript/docs/models/operations/gettoplinksresponsebody.md b/typescript/docs/models/operations/gettoplinksresponsebody.md new file mode 100644 index 00000000..0896894b --- /dev/null +++ b/typescript/docs/models/operations/gettoplinksresponsebody.md @@ -0,0 +1,9 @@ +# GetTopLinksResponseBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `link` | *string* | :heavy_check_mark: | The unique ID of the short link | +| `clicks` | *number* | :heavy_check_mark: | The number of clicks from this link | \ No newline at end of file diff --git a/typescript/docs/models/operations/gettopurlsqueryparamcountry.md b/typescript/docs/models/operations/gettopurlsqueryparamcountry.md new file mode 100644 index 00000000..7beebe7c --- /dev/null +++ b/typescript/docs/models/operations/gettopurlsqueryparamcountry.md @@ -0,0 +1,259 @@ +# GetTopURLsQueryParamCountry + +The country to retrieve analytics for. + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/gettopurlsqueryparaminterval.md b/typescript/docs/models/operations/gettopurlsqueryparaminterval.md new file mode 100644 index 00000000..ce6c83f5 --- /dev/null +++ b/typescript/docs/models/operations/gettopurlsqueryparaminterval.md @@ -0,0 +1,15 @@ +# GetTopURLsQueryParamInterval + +The interval to retrieve analytics for. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `Oneh` | 1h | +| `TwentyFourh` | 24h | +| `Sevend` | 7d | +| `Thirtyd` | 30d | +| `Ninetyd` | 90d | +| `All` | all | \ No newline at end of file diff --git a/typescript/docs/models/operations/gettopurlsrequest.md b/typescript/docs/models/operations/gettopurlsrequest.md new file mode 100644 index 00000000..873141b1 --- /dev/null +++ b/typescript/docs/models/operations/gettopurlsrequest.md @@ -0,0 +1,20 @@ +# GetTopURLsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | The ID of the workspace the link belongs to. | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. | +| `key` | *string* | :heavy_minus_sign: | The short link slug. | +| `interval` | [operations.GetTopURLsQueryParamInterval](../../models/operations/gettopurlsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve analytics for. | +| `country` | [operations.GetTopURLsQueryParamCountry](../../models/operations/gettopurlsqueryparamcountry.md) | :heavy_minus_sign: | The country to retrieve analytics for. | +| `city` | *string* | :heavy_minus_sign: | The city to retrieve analytics for. | +| `device` | *string* | :heavy_minus_sign: | The device to retrieve analytics for. | +| `browser` | *string* | :heavy_minus_sign: | The browser to retrieve analytics for. | +| `os` | *string* | :heavy_minus_sign: | The OS to retrieve analytics for. | +| `referer` | *string* | :heavy_minus_sign: | The referer to retrieve analytics for. | +| `url` | *string* | :heavy_minus_sign: | The URL to retrieve analytics for. | +| `excludeRoot` | *boolean* | :heavy_minus_sign: | Whether to exclude the root link from the response. | +| `tagId` | *string* | :heavy_minus_sign: | The tag ID to retrieve analytics for. | \ No newline at end of file diff --git a/typescript/docs/models/operations/gettopurlsresponsebody.md b/typescript/docs/models/operations/gettopurlsresponsebody.md new file mode 100644 index 00000000..ee01b3d8 --- /dev/null +++ b/typescript/docs/models/operations/gettopurlsresponsebody.md @@ -0,0 +1,9 @@ +# GetTopURLsResponseBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `url` | *string* | :heavy_check_mark: | The destination URL | +| `clicks` | *number* | :heavy_check_mark: | The number of clicks from this URL | \ No newline at end of file diff --git a/typescript/docs/models/operations/getworkspacerequest.md b/typescript/docs/models/operations/getworkspacerequest.md new file mode 100644 index 00000000..b28840c5 --- /dev/null +++ b/typescript/docs/models/operations/getworkspacerequest.md @@ -0,0 +1,8 @@ +# GetWorkspaceRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `idOrSlug` | *string* | :heavy_check_mark: | The ID or slug of the workspace. | \ No newline at end of file diff --git a/typescript/docs/models/operations/groupby.md b/typescript/docs/models/operations/groupby.md new file mode 100644 index 00000000..57f29de8 --- /dev/null +++ b/typescript/docs/models/operations/groupby.md @@ -0,0 +1,4 @@ +# GroupBy + +The field to group the links by. + diff --git a/typescript/docs/models/operations/interval.md b/typescript/docs/models/operations/interval.md new file mode 100644 index 00000000..efa8f7c6 --- /dev/null +++ b/typescript/docs/models/operations/interval.md @@ -0,0 +1,15 @@ +# Interval + +The interval to retrieve analytics for. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `Oneh` | 1h | +| `TwentyFourh` | 24h | +| `Sevend` | 7d | +| `Thirtyd` | 30d | +| `Ninetyd` | 90d | +| `All` | all | \ No newline at end of file diff --git a/typescript/docs/models/operations/level.md b/typescript/docs/models/operations/level.md new file mode 100644 index 00000000..ff37c9ae --- /dev/null +++ b/typescript/docs/models/operations/level.md @@ -0,0 +1,13 @@ +# Level + +The level of error correction to use for the QR code. Defaults to `L` if not provided. + + +## Values + +| Name | Value | +| ----- | ----- | +| `L` | L | +| `M` | M | +| `Q` | Q | +| `H` | H | \ No newline at end of file diff --git a/typescript/docs/models/operations/one.md b/typescript/docs/models/operations/one.md new file mode 100644 index 00000000..187e6eb4 --- /dev/null +++ b/typescript/docs/models/operations/one.md @@ -0,0 +1,8 @@ +# One + + +## Values + +| Name | Value | +| -------- | -------- | +| `Domain` | domain | \ No newline at end of file diff --git a/typescript/docs/models/operations/queryparamcountry.md b/typescript/docs/models/operations/queryparamcountry.md new file mode 100644 index 00000000..e55054c5 --- /dev/null +++ b/typescript/docs/models/operations/queryparamcountry.md @@ -0,0 +1,259 @@ +# QueryParamCountry + +The country to retrieve analytics for. + + +## Values + +| Name | Value | +| ----- | ----- | +| `Af` | AF | +| `Al` | AL | +| `Dz` | DZ | +| `As` | AS | +| `Ad` | AD | +| `Ao` | AO | +| `Ai` | AI | +| `Aq` | AQ | +| `Ag` | AG | +| `Ar` | AR | +| `Am` | AM | +| `Aw` | AW | +| `Au` | AU | +| `At` | AT | +| `Az` | AZ | +| `Bs` | BS | +| `Bh` | BH | +| `Bd` | BD | +| `Bb` | BB | +| `By` | BY | +| `Be` | BE | +| `Bz` | BZ | +| `Bj` | BJ | +| `Bm` | BM | +| `Bt` | BT | +| `Bo` | BO | +| `Ba` | BA | +| `Bw` | BW | +| `Bv` | BV | +| `Br` | BR | +| `Io` | IO | +| `Bn` | BN | +| `Bg` | BG | +| `Bf` | BF | +| `Bi` | BI | +| `Kh` | KH | +| `Cm` | CM | +| `Ca` | CA | +| `Cv` | CV | +| `Ky` | KY | +| `Cf` | CF | +| `Td` | TD | +| `Cl` | CL | +| `Cn` | CN | +| `Cx` | CX | +| `Cc` | CC | +| `Co` | CO | +| `Km` | KM | +| `Cg` | CG | +| `Cd` | CD | +| `Ck` | CK | +| `Cr` | CR | +| `Ci` | CI | +| `Hr` | HR | +| `Cu` | CU | +| `Cy` | CY | +| `Cz` | CZ | +| `Dk` | DK | +| `Dj` | DJ | +| `Dm` | DM | +| `Do` | DO | +| `Ec` | EC | +| `Eg` | EG | +| `Sv` | SV | +| `Gq` | GQ | +| `Er` | ER | +| `Ee` | EE | +| `Et` | ET | +| `Fk` | FK | +| `Fo` | FO | +| `Fj` | FJ | +| `Fi` | FI | +| `Fr` | FR | +| `Gf` | GF | +| `Pf` | PF | +| `Tf` | TF | +| `Ga` | GA | +| `Gm` | GM | +| `Ge` | GE | +| `De` | DE | +| `Gh` | GH | +| `Gi` | GI | +| `Gr` | GR | +| `Gl` | GL | +| `Gd` | GD | +| `Gp` | GP | +| `Gu` | GU | +| `Gt` | GT | +| `Gn` | GN | +| `Gw` | GW | +| `Gy` | GY | +| `Ht` | HT | +| `Hm` | HM | +| `Va` | VA | +| `Hn` | HN | +| `Hk` | HK | +| `Hu` | HU | +| `Is` | IS | +| `In` | IN | +| `Id` | ID | +| `Ir` | IR | +| `Iq` | IQ | +| `Ie` | IE | +| `Il` | IL | +| `It` | IT | +| `Jm` | JM | +| `Jp` | JP | +| `Jo` | JO | +| `Kz` | KZ | +| `Ke` | KE | +| `Ki` | KI | +| `Kp` | KP | +| `Kr` | KR | +| `Kw` | KW | +| `Kg` | KG | +| `La` | LA | +| `Lv` | LV | +| `Lb` | LB | +| `Ls` | LS | +| `Lr` | LR | +| `Ly` | LY | +| `Li` | LI | +| `Lt` | LT | +| `Lu` | LU | +| `Mo` | MO | +| `Mg` | MG | +| `Mw` | MW | +| `My` | MY | +| `Mv` | MV | +| `Ml` | ML | +| `Mt` | MT | +| `Mh` | MH | +| `Mq` | MQ | +| `Mr` | MR | +| `Mu` | MU | +| `Yt` | YT | +| `Mx` | MX | +| `Fm` | FM | +| `Md` | MD | +| `Mc` | MC | +| `Mn` | MN | +| `Ms` | MS | +| `Ma` | MA | +| `Mz` | MZ | +| `Mm` | MM | +| `Na` | NA | +| `Nr` | NR | +| `Np` | NP | +| `Nl` | NL | +| `Nc` | NC | +| `Nz` | NZ | +| `Ni` | NI | +| `Ne` | NE | +| `Ng` | NG | +| `Nu` | NU | +| `Nf` | NF | +| `Mk` | MK | +| `Mp` | MP | +| `No` | NO | +| `Om` | OM | +| `Pk` | PK | +| `Pw` | PW | +| `Ps` | PS | +| `Pa` | PA | +| `Pg` | PG | +| `Py` | PY | +| `Pe` | PE | +| `Ph` | PH | +| `Pn` | PN | +| `Pl` | PL | +| `Pt` | PT | +| `Pr` | PR | +| `Qa` | QA | +| `Re` | RE | +| `Ro` | RO | +| `Ru` | RU | +| `Rw` | RW | +| `Sh` | SH | +| `Kn` | KN | +| `Lc` | LC | +| `Pm` | PM | +| `Vc` | VC | +| `Ws` | WS | +| `Sm` | SM | +| `St` | ST | +| `Sa` | SA | +| `Sn` | SN | +| `Sc` | SC | +| `Sl` | SL | +| `Sg` | SG | +| `Sk` | SK | +| `Si` | SI | +| `Sb` | SB | +| `So` | SO | +| `Za` | ZA | +| `Gs` | GS | +| `Es` | ES | +| `Lk` | LK | +| `Sd` | SD | +| `Sr` | SR | +| `Sj` | SJ | +| `Sz` | SZ | +| `Se` | SE | +| `Ch` | CH | +| `Sy` | SY | +| `Tw` | TW | +| `Tj` | TJ | +| `Tz` | TZ | +| `Th` | TH | +| `Tl` | TL | +| `Tg` | TG | +| `Tk` | TK | +| `To` | TO | +| `Tt` | TT | +| `Tn` | TN | +| `Tr` | TR | +| `Tm` | TM | +| `Tc` | TC | +| `Tv` | TV | +| `Ug` | UG | +| `Ua` | UA | +| `Ae` | AE | +| `Gb` | GB | +| `Us` | US | +| `Um` | UM | +| `Uy` | UY | +| `Uz` | UZ | +| `Vu` | VU | +| `Ve` | VE | +| `Vn` | VN | +| `Vg` | VG | +| `Vi` | VI | +| `Wf` | WF | +| `Eh` | EH | +| `Ye` | YE | +| `Zm` | ZM | +| `Zw` | ZW | +| `Ax` | AX | +| `Bq` | BQ | +| `Cw` | CW | +| `Gg` | GG | +| `Im` | IM | +| `Je` | JE | +| `Me` | ME | +| `Bl` | BL | +| `Mf` | MF | +| `Rs` | RS | +| `Sx` | SX | +| `Ss` | SS | +| `Xk` | XK | \ No newline at end of file diff --git a/typescript/docs/models/operations/queryparaminterval.md b/typescript/docs/models/operations/queryparaminterval.md new file mode 100644 index 00000000..0a9b632d --- /dev/null +++ b/typescript/docs/models/operations/queryparaminterval.md @@ -0,0 +1,15 @@ +# QueryParamInterval + +The interval to retrieve analytics for. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `Oneh` | 1h | +| `TwentyFourh` | 24h | +| `Sevend` | 7d | +| `Thirtyd` | 30d | +| `Ninetyd` | 90d | +| `All` | all | \ No newline at end of file diff --git a/typescript/docs/models/operations/queryparamtagids.md b/typescript/docs/models/operations/queryparamtagids.md new file mode 100644 index 00000000..dcb80e17 --- /dev/null +++ b/typescript/docs/models/operations/queryparamtagids.md @@ -0,0 +1,4 @@ +# QueryParamTagIds + +The tag IDs to filter the links by. + diff --git a/typescript/docs/models/operations/requestbody.md b/typescript/docs/models/operations/requestbody.md new file mode 100644 index 00000000..4add0644 --- /dev/null +++ b/typescript/docs/models/operations/requestbody.md @@ -0,0 +1,27 @@ +# RequestBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `domain` | *string* | :heavy_minus_sign: | The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). | +| `key` | *string* | :heavy_minus_sign: | The short link slug. If not provided, a random 7-character slug will be generated. | +| `prefix` | *string* | :heavy_minus_sign: | The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. | +| `url` | *string* | :heavy_check_mark: | The destination URL of the short link. | +| `archived` | *boolean* | :heavy_minus_sign: | Whether the short link is archived. | +| `expiresAt` | *string* | :heavy_minus_sign: | The date and time when the short link will expire at. | +| `expiredUrl` | *string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | +| `password` | *string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | +| `proxy` | *boolean* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | +| `title` | *string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `description` | *string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `image` | *string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `rewrite` | *boolean* | :heavy_minus_sign: | Whether the short link uses link cloaking. | +| `ios` | *string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | +| `android` | *string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | +| `geo` | Record | :heavy_minus_sign: | Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. | +| `publicStats` | *boolean* | :heavy_minus_sign: | Whether the short link's stats are publicly accessible. | +| ~~`tagId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

[DEPRECATED] (use tagIds instead): The unique ID of the tag assigned to the short link. | +| `tagIds` | *operations.BulkCreateLinksTagIds* | :heavy_minus_sign: | The unique IDs of the tags assigned to the short link. | +| `comments` | *string* | :heavy_minus_sign: | The comments for the short link. | \ No newline at end of file diff --git a/typescript/docs/models/operations/responsebody.md b/typescript/docs/models/operations/responsebody.md new file mode 100644 index 00000000..af29a48a --- /dev/null +++ b/typescript/docs/models/operations/responsebody.md @@ -0,0 +1,9 @@ +# ResponseBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `start` | *string* | :heavy_check_mark: | The starting timestamp of the interval | +| `clicks` | *number* | :heavy_check_mark: | The number of clicks in the interval | \ No newline at end of file diff --git a/typescript/docs/models/operations/sort.md b/typescript/docs/models/operations/sort.md new file mode 100644 index 00000000..4e57289a --- /dev/null +++ b/typescript/docs/models/operations/sort.md @@ -0,0 +1,12 @@ +# Sort + +The field to sort the links by. The default is `createdAt`, and sort order is always descending. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `CreatedAt` | createdAt | +| `Clicks` | clicks | +| `LastClicked` | lastClicked | \ No newline at end of file diff --git a/typescript/docs/models/operations/tagids.md b/typescript/docs/models/operations/tagids.md new file mode 100644 index 00000000..8dca755b --- /dev/null +++ b/typescript/docs/models/operations/tagids.md @@ -0,0 +1,4 @@ +# TagIds + +The unique IDs of the tags assigned to the short link. + diff --git a/typescript/docs/models/operations/two.md b/typescript/docs/models/operations/two.md new file mode 100644 index 00000000..46cb4a60 --- /dev/null +++ b/typescript/docs/models/operations/two.md @@ -0,0 +1,8 @@ +# Two + + +## Values + +| Name | Value | +| ------- | ------- | +| `TagId` | tagId | \ No newline at end of file diff --git a/typescript/docs/sdks/analytics/README.md b/typescript/docs/sdks/analytics/README.md new file mode 100644 index 00000000..5aaab1e6 --- /dev/null +++ b/typescript/docs/sdks/analytics/README.md @@ -0,0 +1,535 @@ +# Analytics +(*analytics*) + +### Available Operations + +* [getClicksAnalytics](#getclicksanalytics) - Retrieve clicks analytics +* [getTimeseriesAnalytics](#gettimeseriesanalytics) - Retrieve timeseries analytics +* [getCountryAnalytics](#getcountryanalytics) - Retrieve country analytics +* [getCityAnalytics](#getcityanalytics) - Retrieve city analytics +* [getDeviceAnalytics](#getdeviceanalytics) - Retrieve device analytics +* [getBrowserAnalytics](#getbrowseranalytics) - Retrieve browser analytics +* [getOSAnalytics](#getosanalytics) - Retrieve OS analytics +* [getRefererAnalytics](#getrefereranalytics) - Retrieve referer analytics +* [getTopLinks](#gettoplinks) - Retrieve top links +* [getTopURLs](#gettopurls) - Retrieve top URLs + +## getClicksAnalytics + +Retrieve the number of clicks for a link, a domain, or the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.analytics.getClicksAnalytics({ + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetClicksAnalyticsRequest](../../models/operations/getclicksanalyticsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[number](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getTimeseriesAnalytics + +Retrieve the number of clicks for a link, a domain, or the authenticated workspace over a period of time. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.analytics.getTimeseriesAnalytics({ + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetTimeseriesAnalyticsRequest](../../models/operations/gettimeseriesanalyticsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[operations.ResponseBody[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getCountryAnalytics + +Retrieve the top countries by number of clicks for a link, a domain, or the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.analytics.getCountryAnalytics({ + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCountryAnalyticsRequest](../../models/operations/getcountryanalyticsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[operations.GetCountryAnalyticsResponseBody[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getCityAnalytics + +Retrieve the top countries by number of clicks for a link, a domain, or the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.analytics.getCityAnalytics({ + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCityAnalyticsRequest](../../models/operations/getcityanalyticsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[operations.GetCityAnalyticsResponseBody[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getDeviceAnalytics + +Retrieve the top devices by number of clicks for a link, a domain, or the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.analytics.getDeviceAnalytics({ + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetDeviceAnalyticsRequest](../../models/operations/getdeviceanalyticsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[operations.GetDeviceAnalyticsResponseBody[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getBrowserAnalytics + +Retrieve the top browsers by number of clicks for a link, a domain, or the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.analytics.getBrowserAnalytics({ + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetBrowserAnalyticsRequest](../../models/operations/getbrowseranalyticsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[operations.GetBrowserAnalyticsResponseBody[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getOSAnalytics + +Retrieve the top OS by number of clicks for a link, a domain, or the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.analytics.getOSAnalytics({ + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetOSAnalyticsRequest](../../models/operations/getosanalyticsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[operations.GetOSAnalyticsResponseBody[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getRefererAnalytics + +Retrieve the top referers by number of clicks for a link, a domain, or the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.analytics.getRefererAnalytics({ + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetRefererAnalyticsRequest](../../models/operations/getrefereranalyticsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[operations.GetRefererAnalyticsResponseBody[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getTopLinks + +Retrieve the top links by number of clicks for a domain or the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.analytics.getTopLinks({ + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetTopLinksRequest](../../models/operations/gettoplinksrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[operations.GetTopLinksResponseBody[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getTopURLs + +Retrieve the top URLs by number of clicks for a given short link. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.analytics.getTopURLs({ + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetTopURLsRequest](../../models/operations/gettopurlsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[operations.GetTopURLsResponseBody[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/typescript/docs/sdks/dub/README.md b/typescript/docs/sdks/dub/README.md new file mode 100644 index 00000000..15c31150 --- /dev/null +++ b/typescript/docs/sdks/dub/README.md @@ -0,0 +1,9 @@ +# Dub SDK + + +## Overview + +Dub.co API: Dub is link management infrastructure for companies to create marketing campaigns, link sharing features, and referral programs. + +### Available Operations + diff --git a/typescript/docs/sdks/links/README.md b/typescript/docs/sdks/links/README.md new file mode 100644 index 00000000..a73eeb82 --- /dev/null +++ b/typescript/docs/sdks/links/README.md @@ -0,0 +1,409 @@ +# Links +(*links*) + +### Available Operations + +* [getLinks](#getlinks) - Retrieve a list of links +* [createLink](#createlink) - Create a new link +* [getLinksCount](#getlinkscount) - Retrieve the number of links +* [getLinkInfo](#getlinkinfo) - Retrieve a link +* [editLink](#editlink) - Edit a link +* [deleteLink](#deletelink) - Delete a link +* [bulkCreateLinks](#bulkcreatelinks) - Bulk create links + +## getLinks + +Retrieve a list of links for the authenticated workspace. The list will be paginated and the provided query parameters allow filtering the returned links. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.links.getLinks({ + workspaceId: "", + tagIds: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetLinksRequest](../../models/operations/getlinksrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.LinkSchema[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## createLink + +Create a new link for the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.links.createLink({ + workspaceId: "", + requestBody: { + url: "https://first-marxism.net", + geo: { + "key": "", + }, + tagIds: "", + }, + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateLinkRequest](../../models/operations/createlinkrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.LinkSchema](../../models/components/linkschema.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getLinksCount + +Retrieve the number of links for the authenticated workspace. The provided query parameters allow filtering the returned links. + +### Example Usage + +```typescript +import { Dub } from "dub"; +import { Two } from "dub/models/operations"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.links.getLinksCount({ + workspaceId: "", + tagIds: [ + "", + ], + groupBy: Two.TagId, + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetLinksCountRequest](../../models/operations/getlinkscountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.LinkSchema[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getLinkInfo + +Retrieve the info for a link from their domain and key. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.links.getLinkInfo({ + workspaceId: "", + domain: "harmonious-venti.org", + key: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetLinkInfoRequest](../../models/operations/getlinkinforequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.LinkSchema](../../models/components/linkschema.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## editLink + +Edit a link for the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.links.editLink({ + linkId: "", + workspaceId: "", + requestBody: { + url: "https://fruitful-strategy.com", + geo: { + "key": "", + }, + tagIds: "", + }, + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.EditLinkRequest](../../models/operations/editlinkrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.LinkSchema](../../models/components/linkschema.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## deleteLink + +Delete a link for the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.links.deleteLink({ + linkId: "", + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteLinkRequest](../../models/operations/deletelinkrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.LinkSchema](../../models/components/linkschema.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## bulkCreateLinks + +Bulk create up to 100 links for the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.links.bulkCreateLinks({ + workspaceId: "", + requestBody: [ + { + url: "https://impish-brow.info", + geo: { + "key": "", + }, + tagIds: "", + }, + ], + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.BulkCreateLinksRequest](../../models/operations/bulkcreatelinksrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.LinkSchema[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/typescript/docs/sdks/qrcodes/README.md b/typescript/docs/sdks/qrcodes/README.md new file mode 100644 index 00000000..480f951f --- /dev/null +++ b/typescript/docs/sdks/qrcodes/README.md @@ -0,0 +1,56 @@ +# QRCodes +(*qrCodes*) + +### Available Operations + +* [getQRCode](#getqrcode) - Retrieve a QR code + +## getQRCode + +Retrieve a QR code for a link. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.qrCodes.getQRCode({}); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetQRCodeRequest](../../models/operations/getqrcoderequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[string](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/typescript/docs/sdks/tags/README.md b/typescript/docs/sdks/tags/README.md new file mode 100644 index 00000000..c43642fb --- /dev/null +++ b/typescript/docs/sdks/tags/README.md @@ -0,0 +1,114 @@ +# Tags +(*tags*) + +### Available Operations + +* [getTags](#gettags) - Retrieve a list of tags +* [createTag](#createtag) - Create a new tag + +## getTags + +Retrieve a list of tags for the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.tags.getTags({ + workspaceId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetTagsRequest](../../models/operations/gettagsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.TagSchema[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## createTag + +Create a new tag for the authenticated workspace. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.tags.createTag({ + workspaceId: "", + requestBody: { + tag: "", + }, + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateTagRequest](../../models/operations/createtagrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.TagSchema](../../models/components/tagschema.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/typescript/docs/sdks/workspaces/README.md b/typescript/docs/sdks/workspaces/README.md new file mode 100644 index 00000000..393a5f54 --- /dev/null +++ b/typescript/docs/sdks/workspaces/README.md @@ -0,0 +1,162 @@ +# Workspaces +(*workspaces*) + +### Available Operations + +* [getWorkspaces](#getworkspaces) - Retrieve a list of workspaces +* [createWorkspace](#createworkspace) - Create a workspace +* [getWorkspace](#getworkspace) - Retrieve a workspace + +## getWorkspaces + +Retrieve a list of workspaces for the authenticated user. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.workspaces.getWorkspaces(); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.WorkspaceSchema[]](../../models/.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## createWorkspace + +Create a new workspace for the authenticated user. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.workspaces.createWorkspace({ + name: "", + slug: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateWorkspaceRequestBody](../../models/operations/createworkspacerequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.WorkspaceSchema](../../models/components/workspaceschema.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | + +## getWorkspace + +Retrieve a workspace for the authenticated user. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +async function run() { + const sdk = new Dub({ + bearerToken: "", + }); + + const result = await sdk.workspaces.getWorkspace({ + idOrSlug: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetWorkspaceRequest](../../models/operations/getworkspacerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | + + +### Response + +**Promise<[components.WorkspaceSchema](../../models/components/workspaceschema.md)>** +### Errors + +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| errors.FourHundred | 400 | application/json | +| errors.FourHundredAndOne | 401 | application/json | +| errors.FourHundredAndThree | 403 | application/json | +| errors.FourHundredAndFour | 404 | application/json | +| errors.FourHundredAndNine | 409 | application/json | +| errors.FourHundredAndTen | 410 | application/json | +| errors.FourHundredAndTwentyTwo | 422 | application/json | +| errors.FourHundredAndTwentyNine | 429 | application/json | +| errors.FiveHundred | 500 | application/json | +| errors.SDKError | 4xx-5xx | */* | diff --git a/typescript/package-lock.json b/typescript/package-lock.json new file mode 100644 index 00000000..cf47513f --- /dev/null +++ b/typescript/package-lock.json @@ -0,0 +1,4528 @@ +{ + "name": "dub", + "version": "0.18.3", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "dub", + "version": "0.18.3", + "devDependencies": { + "@types/jsonpath": "^0.2.4", + "@typescript-eslint/eslint-plugin": "^6.13.2", + "@typescript-eslint/parser": "^6.13.2", + "eslint": "^8.55.0", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-import": "^2.29.0", + "typescript": "^5.3.3", + "vitest": "1.4.0", + "zod": "^3.22.4" + }, + "peerDependencies": { + "zod": ">= 3" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.13.2.tgz", + "integrity": "sha512-3XFIDKWMFZrMnao1mJhnOT1h2g0169Os848NhhmGweEcfJ4rCi+3yMCOLG4zA61rbJdkcrM/DjVZm9Hg5p5w7g==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.13.2.tgz", + "integrity": "sha512-GdxxXbAuM7Y/YQM9/TwwP+L0omeE/lJAR1J+olu36c3LqqZEBdsIWeQ91KBe6nxwOnb06Xh7JS2U5ooWU5/LgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.13.2.tgz", + "integrity": "sha512-mCMlpzlBgOTdaFs83I4XRr8wNPveJiJX1RLfv4hggyIVhfB5mJfN4P8Z6yKh+oE4Luz+qq1P3kVdWrCKcMYrrA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.13.2.tgz", + "integrity": "sha512-yUoEvnH0FBef/NbB1u6d3HNGyruAKnN74LrPAfDQL3O32e3k3OSfLrPgSJmgb3PJrBZWfPyt6m4ZhAFa2nZp2A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.13.2.tgz", + "integrity": "sha512-GYbLs5ErswU/Xs7aGXqzc3RrdEjKdmoCrgzhJWyFL0r5fL3qd1NPcDKDowDnmcoSiGJeU68/Vy+OMUluRxPiLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.13.2.tgz", + "integrity": "sha512-L1+D8/wqGnKQIlh4Zre9i4R4b4noxzH5DDciyahX4oOz62CphY7WDWqJoQ66zNR4oScLNOqQJfNSIAe/6TPUmQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.13.2.tgz", + "integrity": "sha512-tK5eoKFkXdz6vjfkSTCupUzCo40xueTOiOO6PeEIadlNBkadH1wNOH8ILCPIl8by/Gmb5AGAeQOFeLev7iZDOA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.13.2.tgz", + "integrity": "sha512-zvXvAUGGEYi6tYhcDmb9wlOckVbuD+7z3mzInCSTACJ4DQrdSLPNUeDIcAQW39M3q6PDquqLWu7pnO39uSMRzQ==", + "cpu": [ + "ppc64le" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.13.2.tgz", + "integrity": "sha512-C3GSKvMtdudHCN5HdmAMSRYR2kkhgdOfye4w0xzyii7lebVr4riCgmM6lRiSCnJn2w1Xz7ZZzHKuLrjx5620kw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.13.2.tgz", + "integrity": "sha512-l4U0KDFwzD36j7HdfJ5/TveEQ1fUTjFFQP5qIt9gBqBgu1G8/kCaq5Ok05kd5TG9F8Lltf3MoYsUMw3rNlJ0Yg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.13.2.tgz", + "integrity": "sha512-xXMLUAMzrtsvh3cZ448vbXqlUa7ZL8z0MwHp63K2IIID2+DeP5iWIT6g1SN7hg1VxPzqx0xZdiDM9l4n9LRU1A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.13.2.tgz", + "integrity": "sha512-M/JYAWickafUijWPai4ehrjzVPKRCyDb1SLuO+ZyPfoXgeCEAlgPkNXewFZx0zcnoIe3ay4UjXIMdXQXOZXWqA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.13.2.tgz", + "integrity": "sha512-2YWwoVg9KRkIKaXSh0mz3NmfurpmYoBBTAXA9qt7VXk0Xy12PoOP40EFuau+ajgALbbhi4uTj3tSG3tVseCjuA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.13.2.tgz", + "integrity": "sha512-2FSsE9aQ6OWD20E498NYKEQLneShWes0NGMPQwxWOdws35qQXH+FplabOSP5zEe1pVjurSDOGEVCE2agFwSEsw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.13.2.tgz", + "integrity": "sha512-7h7J2nokcdPePdKykd8wtc8QqqkqxIrUz7MHj6aNr8waBRU//NLDVnNjQnqQO6fqtjrtCdftpbTuOKAyrAQETQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, + "node_modules/@types/jsonpath": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.4.tgz", + "integrity": "sha512-K3hxB8Blw0qgW6ExKgMbXQv2UPZBoE2GqLpVY+yr7nMD2Pq86lsuIzyAaiQ7eMqFL5B6di6pxSkogLJEyEHoGA==", + "dev": true + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", + "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", + "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", + "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/@vitest/expect": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.4.0.tgz", + "integrity": "sha512-Jths0sWCJZ8BxjKe+p+eKsoqev1/T8lYcrjavEaz8auEJ4jAVY0GwW3JKmdVU4mmNPLPHixh4GNXP7GFtAiDHA==", + "dev": true, + "dependencies": { + "@vitest/spy": "1.4.0", + "@vitest/utils": "1.4.0", + "chai": "^4.3.10" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.4.0.tgz", + "integrity": "sha512-EDYVSmesqlQ4RD2VvWo3hQgTJ7ZrFQ2VSJdfiJiArkCerDAGeyF1i6dHkmySqk573jLp6d/cfqCN+7wUB5tLgg==", + "dev": true, + "dependencies": { + "@vitest/utils": "1.4.0", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner/node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/runner/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/snapshot": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.4.0.tgz", + "integrity": "sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.4.0.tgz", + "integrity": "sha512-Ywau/Qs1DzM/8Uc+yA77CwSegizMlcgTJuYGAi0jujOteJOUf1ujunHThYo243KG9nAyWT3L9ifPYZ5+As/+6Q==", + "dev": true, + "dependencies": { + "tinyspy": "^2.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.4.0.tgz", + "integrity": "sha512-mx3Yd1/6e2Vt/PUC98DcqTirtfxUyAZ32uK82r8rZzbtBeBo+nqgnjx/LvqQdWsrvNtm14VmurNgcf4nqY5gJg==", + "dev": true, + "dependencies": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz", + "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/esbuild": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", + "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "enhanced-resolve": "^5.12.0", + "eslint-module-utils": "^2.7.4", + "fast-glob": "^3.3.1", + "get-tsconfig": "^4.5.0", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", + "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==", + "dev": true, + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-tsconfig": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz", + "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/jsonc-parser": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", + "dev": true + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/magic-string": { + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mlly": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", + "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.0.3", + "ufo": "^1.3.2" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "dev": true, + "dependencies": { + "jsonc-parser": "^3.2.0", + "mlly": "^1.2.0", + "pathe": "^1.1.0" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rollup": { + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.13.2.tgz", + "integrity": "sha512-MIlLgsdMprDBXC+4hsPgzWUasLO9CE4zOkj/u6j+Z6j5A4zRY+CtiXAdJyPtgCsc42g658Aeh1DlrdVEJhsL2g==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.13.2", + "@rollup/rollup-android-arm64": "4.13.2", + "@rollup/rollup-darwin-arm64": "4.13.2", + "@rollup/rollup-darwin-x64": "4.13.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.13.2", + "@rollup/rollup-linux-arm64-gnu": "4.13.2", + "@rollup/rollup-linux-arm64-musl": "4.13.2", + "@rollup/rollup-linux-powerpc64le-gnu": "4.13.2", + "@rollup/rollup-linux-riscv64-gnu": "4.13.2", + "@rollup/rollup-linux-s390x-gnu": "4.13.2", + "@rollup/rollup-linux-x64-gnu": "4.13.2", + "@rollup/rollup-linux-x64-musl": "4.13.2", + "@rollup/rollup-win32-arm64-msvc": "4.13.2", + "@rollup/rollup-win32-ia32-msvc": "4.13.2", + "@rollup/rollup-win32-x64-msvc": "4.13.2", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, + "node_modules/std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-literal": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", + "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", + "dev": true, + "dependencies": { + "js-tokens": "^9.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/tinybench": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", + "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.3.tgz", + "integrity": "sha512-Ud7uepAklqRH1bvwy22ynrliC7Dljz7Tm8M/0RBUW+YRa4YHhZ6e4PpgE+fu1zr/WqB1kbeuVrdfeuyIBpy4tw==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", + "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/ufo": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", + "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", + "dev": true + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vite": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.7.tgz", + "integrity": "sha512-k14PWOKLI6pMaSzAuGtT+Cf0YmIx12z9YGon39onaJNy8DLBfBJrzg9FQEmkAM5lpHBZs9wksWAsyF/HkpEwJA==", + "dev": true, + "dependencies": { + "esbuild": "^0.20.1", + "postcss": "^8.4.38", + "rollup": "^4.13.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.4.0.tgz", + "integrity": "sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.4.0.tgz", + "integrity": "sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==", + "dev": true, + "dependencies": { + "@vitest/expect": "1.4.0", + "@vitest/runner": "1.4.0", + "@vitest/snapshot": "1.4.0", + "@vitest/spy": "1.4.0", + "@vitest/utils": "1.4.0", + "acorn-walk": "^8.3.2", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.2", + "vite": "^5.0.0", + "vite-node": "1.4.0", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "1.4.0", + "@vitest/ui": "1.4.0", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/typescript/package.json b/typescript/package.json new file mode 100644 index 00000000..d0eb0039 --- /dev/null +++ b/typescript/package.json @@ -0,0 +1,30 @@ +{ + "name": "dub", + "version": "0.18.3", + "author": "Dub", + "main": "./index.js", + "sideEffects": false, + "scripts": { + "lint": "eslint --max-warnings=0 src", + "build": "tsc", + "prepare": "npm run build" + }, + "keywords": [], + "peerDependencies": { + "zod": ">= 3" + }, + "devDependencies": { + "@types/jsonpath": "^0.2.4", + "@typescript-eslint/eslint-plugin": "^6.13.2", + "@typescript-eslint/parser": "^6.13.2", + "eslint": "^8.55.0", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-import": "^2.29.0", + "typescript": "^5.3.3", + "vitest": "1.4.0", + "zod": "^3.22.4" + }, + "dependencies": { + + } +} diff --git a/typescript/src/hooks/hooks.ts b/typescript/src/hooks/hooks.ts new file mode 100644 index 00000000..74a677aa --- /dev/null +++ b/typescript/src/hooks/hooks.ts @@ -0,0 +1,81 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { + AfterErrorContext, + AfterErrorHook, + AfterSuccessContext, + AfterSuccessHook, + BeforeRequestContext, + BeforeRequestHook, + Hooks, + SDKInitHook, + SDKInitOptions, +} from "./types"; + +export class SDKHooks implements Hooks { + sdkInitHooks: SDKInitHook[] = []; + beforeRequestHooks: BeforeRequestHook[] = []; + afterSuccessHooks: AfterSuccessHook[] = []; + afterErrorHooks: AfterErrorHook[] = []; + + constructor() {} + + registerSDKInitHook(hook: SDKInitHook) { + this.sdkInitHooks.push(hook); + } + + registerBeforeRequestHook(hook: BeforeRequestHook) { + this.beforeRequestHooks.push(hook); + } + + registerAfterSuccessHook(hook: AfterSuccessHook) { + this.afterSuccessHooks.push(hook); + } + + registerAfterErrorHook(hook: AfterErrorHook) { + this.afterErrorHooks.push(hook); + } + + sdkInit(opts: SDKInitOptions): SDKInitOptions { + return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts); + } + + async beforeRequest(hookCtx: BeforeRequestContext, request: Request): Promise { + let req = request; + + for (const hook of this.beforeRequestHooks) { + req = await hook.beforeRequest(hookCtx, req); + } + + return req; + } + + async afterSuccess(hookCtx: AfterSuccessContext, response: Response): Promise { + let res = response; + + for (const hook of this.afterSuccessHooks) { + res = await hook.afterSuccess(hookCtx, res); + } + + return res; + } + + async afterError( + hookCtx: AfterErrorContext, + response: Response | null, + error: unknown + ): Promise<{ response: Response | null; error: unknown }> { + let res = response; + let err = error; + + for (const hook of this.afterErrorHooks) { + const result = await hook.afterError(hookCtx, res, err); + res = result.response; + err = result.error; + } + + return { response: res, error: err }; + } +} diff --git a/typescript/src/hooks/index.ts b/typescript/src/hooks/index.ts new file mode 100644 index 00000000..3df03930 --- /dev/null +++ b/typescript/src/hooks/index.ts @@ -0,0 +1,6 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +export * from "./types"; +export * from "./hooks"; diff --git a/typescript/src/hooks/types.ts b/typescript/src/hooks/types.ts new file mode 100644 index 00000000..62f8e142 --- /dev/null +++ b/typescript/src/hooks/types.ts @@ -0,0 +1,74 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { HTTPClient } from "../lib/http"; + +export type HookContext = { + operationID: string; + oAuth2Scopes?: string[]; + securitySource?: any | (() => Promise); +}; + +export type Awaitable = T | Promise; + +export type SDKInitOptions = { + baseURL: URL | null; + client: HTTPClient; +}; +export type BeforeRequestContext = HookContext & {}; +export type AfterSuccessContext = HookContext & {}; +export type AfterErrorContext = HookContext & {}; + +/** + * SDKInitHook is called when the SDK is initializing. The + * hook can return a new baseURL and HTTP client to be used by the SDK. + */ +export interface SDKInitHook { + sdkInit: (opts: SDKInitOptions) => SDKInitOptions; +} + +/** + * BeforeRequestHook is called before the SDK sends a request. The hook can + * modify the request before it is sent or throw an error to stop the request + * from being sent. + */ +export interface BeforeRequestHook { + beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable; +} + +/** + * AfterSuccessHook is called after the SDK receives a response. The hook can + * modify the response before it is handled or throw an error to stop the + * response from being handled. + */ +export interface AfterSuccessHook { + afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable; +} + +/** + * AfterErrorHook is called after the SDK encounters an error, or a + * non-successful response. The hook can modify the response if available + * otherwise modify the error. + */ +export interface AfterErrorHook { + afterError: ( + hookCtx: AfterErrorContext, + response: Response | null, + error: unknown + ) => Awaitable<{ + response: Response | null; + error: unknown; + }>; +} + +export interface Hooks { + /** Registers a hook to be used by the SDK for initialization event. */ + registerSDKInitHook(hook: SDKInitHook): void; + /** Registers a hook to be used by the SDK for the before request event. */ + registerBeforeRequestHook(hook: BeforeRequestHook): void; + /** Registers a hook to be used by the SDK for the after success event. */ + registerAfterSuccessHook(hook: AfterSuccessHook): void; + /** Registers a hook to be used by the SDK for the after error event. */ + registerAfterErrorHook(hook: AfterErrorHook): void; +} diff --git a/typescript/src/index.ts b/typescript/src/index.ts new file mode 100644 index 00000000..32044eba --- /dev/null +++ b/typescript/src/index.ts @@ -0,0 +1,6 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +export * from "./sdk"; +export * from "./lib/config"; diff --git a/typescript/src/lib/base64.ts b/typescript/src/lib/base64.ts new file mode 100644 index 00000000..cda07641 --- /dev/null +++ b/typescript/src/lib/base64.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +export function bytesToBase64(u8arr: Uint8Array): string { + return btoa(String.fromCodePoint(...u8arr)); +} + +export function bytesFromBase64(encoded: string): Uint8Array { + return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0)); +} + +export function stringToBytes(str: string): Uint8Array { + return new TextEncoder().encode(str); +} + +export function stringFromBytes(u8arr: Uint8Array): string { + return new TextDecoder().decode(u8arr); +} + +export function stringToBase64(str: string): string { + return bytesToBase64(stringToBytes(str)); +} + +export function stringFromBase64(b64str: string): string { + return stringFromBytes(bytesFromBase64(b64str)); +} + +export const zodOutbound = z + .instanceof(Uint8Array) + .or(z.string().transform(stringToBytes)); + +export const zodInbound = z + .instanceof(Uint8Array) + .or(z.string().transform(bytesFromBase64)); diff --git a/typescript/src/lib/config.ts b/typescript/src/lib/config.ts new file mode 100644 index 00000000..68057ce5 --- /dev/null +++ b/typescript/src/lib/config.ts @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { HTTPClient } from "./http"; +import { RetryConfig } from "./retries"; +import { pathToFunc } from "./url"; + +/** + * Contains the list of servers available to the SDK + */ +export const ServerList = [ + /** + * Production API + */ + "https://api.dub.co", +] as const; + +export type SDKOptions = { + bearerToken?: string | (() => Promise); + + httpClient?: HTTPClient; + /** + * Allows overriding the default server used by the SDK + */ + serverIdx?: number; + /** + * Allows overriding the default server URL used by the SDK + */ + serverURL?: string; + /** + * Allows overriding the default retry config used by the SDK + */ + retryConfig?: RetryConfig; +}; + +export function serverURLFromOptions(options: SDKOptions): URL | null { + let serverURL = options.serverURL; + + const params: Record = {}; + + if (!serverURL) { + const serverIdx = options.serverIdx ?? 0; + if (serverIdx < 0 || serverIdx >= ServerList.length) { + throw new Error(`Invalid server index ${serverIdx}`); + } + serverURL = ServerList[serverIdx] || ""; + } + + const u = pathToFunc(serverURL)(params); + return new URL(u); +} + +export const SDK_METADATA = Object.freeze({ + language: "typescript", + openapiDocVersion: "0.0.1", + sdkVersion: "0.18.3", + genVersion: "2.301.0", + userAgent: "speakeasy-sdk/typescript 0.18.3 2.301.0 0.0.1 dub", +}); diff --git a/typescript/src/lib/encodings.ts b/typescript/src/lib/encodings.ts new file mode 100644 index 00000000..71ce003f --- /dev/null +++ b/typescript/src/lib/encodings.ts @@ -0,0 +1,384 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { bytesToBase64 } from "./base64"; + +export class EncodingError extends Error { + constructor(message: string) { + super(message); + this.name = "EncodingError"; + } +} + +export function encodeMatrix( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +) { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join(","); + } else if (isPlainObject(pv)) { + encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `,${encodeString(k)},${encodeValue(v)}`; + }).join(""); + encValue = encValue.slice(1); + } else { + encValue = `${encodeValue(pv)}`; + } + + const keyPrefix = encodeString(pk); + tmp = `${keyPrefix}=${encValue}`; + // trim trailing '=' if value was empty + if (tmp === `${keyPrefix}=`) { + tmp = tmp.slice(0, -1); + } + + // If we end up with the nothing then skip forward + if (!tmp) { + return; + } + + out += `;${tmp}`; + }); + + return out; +} + +export function encodeLabel( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +) { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join("."); + } else if (isPlainObject(pv)) { + encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `.${encodeString(k)}.${encodeValue(v)}`; + }).join(""); + encValue = encValue.slice(1); + } else { + const k = + options?.explode && isPlainObject(value) ? `${encodeString(pk)}=` : ""; + encValue = `${k}${encodeValue(pv)}`; + } + + out += `.${encValue}`; + }); + + return out; +} + +function formEncoder(sep: string) { + return ( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, + ) => { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + const encodedSep = encodeString(sep); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join(encodedSep); + } else if (isPlainObject(pv)) { + encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `${encodeString(k)}${encodedSep}${encodeValue(v)}`; + }).join(encodedSep); + } else { + encValue = `${encodeValue(pv)}`; + } + + tmp = `${encodeString(pk)}=${encValue}`; + + // If we end up with the nothing then skip forward + if (!tmp || tmp === "=") { + return; + } + + out += `&${tmp}`; + }); + + return out.slice(1); + }; +} + +export const encodeForm = formEncoder(","); +export const encodeSpaceDelimited = formEncoder(" "); +export const encodePipeDelimited = formEncoder("|"); + +export function encodeBodyForm( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +) { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = JSON.stringify(pv, jsonReplacer); + } else if (isPlainObject(pv)) { + encValue = JSON.stringify(pv, jsonReplacer); + } else { + encValue = `${encodeValue(pv)}`; + } + + tmp = `${encodeString(pk)}=${encValue}`; + + // If we end up with the nothing then skip forward + if (!tmp || tmp === "=") { + return; + } + + out += `&${tmp}`; + }); + + return out.slice(1); +} + +export function encodeDeepObject( + key: string, + value: unknown, + options?: { charEncoding?: "percent" | "none" }, +) { + if (value == null) { + return ""; + } + + let out = ""; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + if (!isPlainObject(value)) { + throw new EncodingError( + `Value of parameter '${key}' which uses deepObject encoding must be an object`, + ); + } + + Object.entries(value).forEach(([ck, cv]) => { + if (cv === undefined) { + return; + } + + const pk = `${key}[${ck}]`; + + if (isPlainObject(cv)) { + throw new EncodingError( + `Value of parameter field '${pk}' cannot be an array or object.`, + ); + } + + const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; + let encoded = ""; + + encoded = mapDefined(pairs, (v) => { + return `${encodeString(pk)}=${encodeString(serializeValue(v))}`; + }).join("&"); + + out += `&${encoded}`; + }); + + return out.slice(1); +} + +export function encodeJSON( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +) { + if (typeof value === "undefined") { + return ""; + } + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + const encVal = encodeString(JSON.stringify(value, jsonReplacer)); + + return options?.explode ? encVal : `${encodeString(key)}=${encVal}`; +} + +export const encodeSimple = ( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +) => { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + tmp = mapDefined(pv, (v) => `${encodeValue(v)}`).join(","); + } else if (isPlainObject(pv)) { + tmp = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `,${encodeString(k)},${encodeValue(v)}`; + }).join(""); + tmp = tmp.slice(1); + } else { + const k = options?.explode && isPlainObject(value) ? `${pk}=` : ""; + tmp = `${k}${encodeValue(pv)}`; + } + + // If we end up with the nothing then skip forward + if (!tmp) { + return; + } + + out += `,${tmp}`; + }); + + return out.slice(1); +}; + +function explode(key: string, value: unknown): [string, unknown][] { + if (Array.isArray(value)) { + return value.map((v) => [key, v]); + } else if (isPlainObject(value)) { + const o = value ?? {}; + return Object.entries(o).map(([k, v]) => [k, v]); + } else { + return [[key, value]]; + } +} + +function isPlainObject(value: unknown): value is object { + if (typeof value !== "object" || value == null) return false; + const proto = Object.getPrototypeOf(value); + return proto === null || proto === Object.prototype; +} + +function serializeValue(value: unknown): string { + if (value === null) { + return "null"; + } else if (typeof value === "undefined") { + return ""; + } else if (value instanceof Date) { + return value.toISOString(); + } else if (value instanceof Uint8Array) { + return bytesToBase64(value); + } else if (typeof value === "object") { + return JSON.stringify(value, jsonReplacer); + } + + return `${value}`; +} + +function jsonReplacer(_: string, value: unknown) { + if (value instanceof Uint8Array) { + return bytesToBase64(value); + } else { + return value; + } +} + +function mapDefined(inp: T[], mapper: (v: T) => R): R[] { + return inp.reduce((acc, v) => { + if (v === undefined) { + return acc; + } + + const m = mapper(v); + if (m === undefined) { + return acc; + } + + acc.push(m); + + return acc; + }, []); +} + +function mapDefinedEntries( + inp: Iterable<[K, V]>, + mapper: (v: [K, V]) => R, +): R[] { + const acc: R[] = []; + for (const [k, v] of inp) { + if (v === undefined) { + continue; + } + + const m = mapper([k, v]); + if (m === undefined) { + continue; + } + + acc.push(m); + } + + return acc; +} diff --git a/typescript/src/lib/http.ts b/typescript/src/lib/http.ts new file mode 100644 index 00000000..45ef1344 --- /dev/null +++ b/typescript/src/lib/http.ts @@ -0,0 +1,215 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +export type Fetcher = ( + input: RequestInfo | URL, + init?: RequestInit, +) => Promise; + +type Awaitable = T | Promise; + +const DEFAULT_FETCHER: Fetcher = (input, init) => fetch(input, init); + +export interface HTTPClientOptions { + fetcher?: Fetcher; +} + +type BeforeRequestHook = (req: Request) => Awaitable; +type RequestErrorHook = (err: unknown, req: Request) => Awaitable; +type ResponseHook = (res: Response, req: Request) => Awaitable; + +export class HTTPClient { + private fetcher: Fetcher; + private requestHooks: BeforeRequestHook[] = []; + private requestErrorHooks: RequestErrorHook[] = []; + private responseHooks: ResponseHook[] = []; + + constructor(private options: HTTPClientOptions = {}) { + this.fetcher = options.fetcher || DEFAULT_FETCHER; + } + + async request(request: Request): Promise { + let req = request; + for (const hook of this.requestHooks) { + const nextRequest = await hook(req); + if (nextRequest) { + req = nextRequest; + } + } + + try { + const res = await this.fetcher(req); + + for (const hook of this.responseHooks) { + await hook(res, req); + } + + return res; + } catch (err) { + for (const hook of this.requestErrorHooks) { + await hook(err, req); + } + + throw err; + } + } + + /** + * Registers a hook that is called before a request is made. The hook function + * can mutate the request or return a new request. This may be useful to add + * additional information to request such as request IDs and tracing headers. + */ + addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + /** + * Registers a hook that is called when a request cannot be made due to a + * network error. + */ + addHook(hook: "requestError", fn: RequestErrorHook): this; + /** + * Registers a hook that is called when a response has been received from the + * server. + */ + addHook(hook: "response", fn: ResponseHook): this; + addHook( + ...args: + | [hook: "beforeRequest", fn: BeforeRequestHook] + | [hook: "requestError", fn: RequestErrorHook] + | [hook: "response", fn: ResponseHook] + ) { + if (args[0] === "beforeRequest") { + this.requestHooks.push(args[1]); + } else if (args[0] === "requestError") { + this.requestErrorHooks.push(args[1]); + } else if (args[0] === "response") { + this.responseHooks.push(args[1]); + } else { + throw new Error(`Invalid hook type: ${args[0]}`); + } + return this; + } + + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "requestError", fn: RequestErrorHook): this; + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "response", fn: ResponseHook): this; + removeHook( + ...args: + | [hook: "beforeRequest", fn: BeforeRequestHook] + | [hook: "requestError", fn: RequestErrorHook] + | [hook: "response", fn: ResponseHook] + ) { + let target: unknown[]; + if (args[0] === "beforeRequest") { + target = this.requestHooks; + } else if (args[0] === "requestError") { + target = this.requestErrorHooks; + } else if (args[0] === "response") { + target = this.responseHooks; + } else { + throw new Error(`Invalid hook type: ${args[0]}`); + } + + const index = target.findIndex((v) => v === args[1]); + if (index >= 0) { + target.splice(index, 1); + } + + return this; + } + + clone() { + const child = new HTTPClient(this.options); + child.requestHooks = this.requestHooks.slice(); + child.requestErrorHooks = this.requestErrorHooks.slice(); + child.responseHooks = this.responseHooks.slice(); + + return child; + } +} + +export function matchContentType(response: Response, pattern: string): boolean { + if (pattern === "*" || pattern === "*/*") { + return true; + } + + const contentType = + response.headers.get("content-type") ?? "application/octet-stream"; + + const idx = contentType.split(";").findIndex((raw) => { + const ctype = raw.trim(); + if (ctype === pattern) { + return true; + } + + const parts = ctype.split("/"); + if (parts.length !== 2) { + return false; + } + + return `${parts[0]}/*` === pattern || `*/${parts[1]}` === pattern; + }); + + return idx >= 0; +} + +const codeRangeRE = new RegExp("^[0-9]xx$", "i"); + +export function matchStatusCode( + response: Response, + codes: number | string | (number | string)[], +) { + const actual = `${response.status}`; + const expectedCodes = Array.isArray(codes) ? codes : [codes]; + if (!expectedCodes.length) { + return false; + } + + return expectedCodes.some((ec) => { + const code = `${ec}`; + + if (code === "default") { + return true; + } + + if (!codeRangeRE.test(`${code}`)) { + return code === actual; + } + + const expectFamily = code.charAt(0); + if (!expectFamily) { + throw new Error("Invalid status code range"); + } + + const actualFamily = actual.charAt(0); + if (!actualFamily) { + throw new Error(`Invalid response status code: ${actual}`); + } + + return actualFamily === expectFamily; + }); +} + +export function matchResponse( + response: Response, + code: number | string | (number | string)[], + contentTypePattern: string, +): boolean { + return ( + matchStatusCode(response, code) && + matchContentType(response, contentTypePattern) + ); +} + +const headerValRE = /, */; +export function unpackHeaders(headers: Headers): Record { + const out: Record = {}; + + for (const [k, v] of headers.entries()) { + out[k] = v.split(headerValRE); + } + + return out; +} diff --git a/typescript/src/lib/retries.ts b/typescript/src/lib/retries.ts new file mode 100644 index 00000000..ed9b4959 --- /dev/null +++ b/typescript/src/lib/retries.ts @@ -0,0 +1,226 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +export type BackoffStrategy = { + initialInterval: number; + maxInterval: number; + exponent: number; + maxElapsedTime: number; +}; + +const defaultBackoff: BackoffStrategy = { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, +}; + +export type RetryConfig = + | { strategy: "none" } + | { + strategy: "backoff"; + backoff?: BackoffStrategy; + retryConnectionErrors?: boolean; + }; + +class PermanentError extends Error { + inner: unknown; + + constructor(inner: unknown) { + super("Permanent error"); + this.inner = inner; + + Object.setPrototypeOf(this, PermanentError.prototype); + } +} + +class TemporaryError extends Error { + res: Response; + + constructor(res: Response) { + super("Temporary error"); + this.res = res; + + Object.setPrototypeOf(this, TemporaryError.prototype); + } +} + +export async function retry( + fetchFn: () => Promise, + options: { + config: RetryConfig; + statusCodes: string[]; + }, +): Promise { + switch (options.config.strategy) { + case "backoff": + return retryBackoff( + wrapFetcher(fetchFn, { + statusCodes: options.statusCodes, + retryConnectionErrors: !!options.config.retryConnectionErrors, + }), + options.config.backoff ?? defaultBackoff, + ); + default: + return await fetchFn(); + } +} + +function wrapFetcher( + fn: () => Promise, + options: { + statusCodes: string[]; + retryConnectionErrors: boolean; + }, +): () => Promise { + return async () => { + try { + const res = await fn(); + if (isRetryableResponse(res, options.statusCodes)) { + throw new TemporaryError(res); + } + + return res; + } catch (err) { + if (err instanceof TemporaryError) { + throw err; + } + + if ( + options.retryConnectionErrors && + (isTimeoutError(err) || isConnectionError(err)) + ) { + throw err; + } + + throw new PermanentError(err); + } + }; +} + +function isConnectionError(err: unknown) { + if (typeof err !== "object" || err == null) { + return false; + } + + // Covers fetch in Deno as well + const isBrowserErr = + err instanceof TypeError && + err.message.toLowerCase().startsWith("failed to fetch"); + + const isNodeErr = + err instanceof TypeError && + err.message.toLowerCase().startsWith("fetch failed"); + + const isBunErr = "name" in err && err.name === "ConnectionError"; + + const isGenericErr = + "code" in err && + typeof err.code === "string" && + err.code.toLowerCase() === "econnreset"; + + return isBrowserErr || isNodeErr || isGenericErr || isBunErr; +} + +function isTimeoutError(err: unknown) { + if (typeof err !== "object" || err == null) { + return false; + } + + // Fetch in browser, Node.js, Bun, Deno + const isNative = "name" in err && err.name === "TimeoutError"; + + // Node.js HTTP client and Axios + const isGenericErr = + "code" in err && + typeof err.code === "string" && + err.code.toLowerCase() === "econnaborted"; + + return isNative || isGenericErr; +} + +const codeRangeRE = new RegExp("^[0-9]xx$", "i"); + +function isRetryableResponse(res: Response, statusCodes: string[]): boolean { + const actual = `${res.status}`; + + return statusCodes.some((code) => { + if (!codeRangeRE.test(code)) { + return code === actual; + } + + const expectFamily = code.charAt(0); + if (!expectFamily) { + throw new Error("Invalid status code range"); + } + + const actualFamily = actual.charAt(0); + if (!actualFamily) { + throw new Error(`Invalid response status code: ${actual}`); + } + + return actualFamily === expectFamily; + }); +} + +async function retryBackoff( + fn: () => Promise, + strategy: BackoffStrategy, +): Promise { + const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; + + const start = Date.now(); + let x = 0; + + // eslint-disable-next-line no-constant-condition + while (true) { + try { + const res = await fn(); + return res; + } catch (err) { + if (err instanceof PermanentError) { + throw err.inner; + } + const elapsed = Date.now() - start; + if (elapsed > maxElapsedTime) { + if (err instanceof TemporaryError) { + return err.res; + } + + throw err; + } + + let retryInterval = 0; + if (err instanceof TemporaryError && err.res && err.res.headers) { + const retryVal = err.res.headers.get("retry-after") || ""; + if (retryVal != "") { + const parsedNumber = Number(retryVal); + if (!isNaN(parsedNumber) && Number.isInteger(parsedNumber)) { + retryInterval = parsedNumber * 1000; + } else { + const parsedDate = Date.parse(retryVal); + if (!isNaN(parsedDate)) { + const deltaMS = parsedDate - Date.now(); + retryInterval = deltaMS > 0 ? Math.ceil(deltaMS) : 0; + } + } + } + } + + if (retryInterval == 0) { + retryInterval = + initialInterval * Math.pow(x, exponent) + Math.random() * 1000; + } + + const d = Math.min(retryInterval, maxInterval); + + await delay(d); + x++; + } + } +} + +async function delay(delay: number): Promise { + return new Promise((resolve) => setTimeout(resolve, delay)); +} diff --git a/typescript/src/lib/schemas.ts b/typescript/src/lib/schemas.ts new file mode 100644 index 00000000..63ad0ae9 --- /dev/null +++ b/typescript/src/lib/schemas.ts @@ -0,0 +1,22 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { ZodError } from "zod"; +import * as errors from "../models/errors"; + +/** + * Utility function that executes some code which may throw a ZodError. It + * intercepts this error and converts it to an SDKValidationError so as to not + * leak Zod implementation details to user code. + */ +export function parse(rawValue: Inp, fn: (value: Inp) => Out, errorMessage: string): Out { + try { + return fn(rawValue); + } catch (err) { + if (err instanceof ZodError) { + throw new errors.SDKValidationError(errorMessage, err, rawValue); + } + throw err; + } +} diff --git a/typescript/src/lib/sdks.ts b/typescript/src/lib/sdks.ts new file mode 100644 index 00000000..e432c07d --- /dev/null +++ b/typescript/src/lib/sdks.ts @@ -0,0 +1,139 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { HTTPClient, matchResponse, matchStatusCode, unpackHeaders } from "./http"; +import { SecurityState, resolveSecurity, resolveGlobalSecurity } from "./security"; +import { pathToFunc } from "./url"; +import { encodeForm } from "./encodings"; +import { stringToBase64 } from "./base64"; +import { SDKHooks, HookContext } from "../hooks"; + +export type RequestOptions = { + fetchOptions?: Omit; +}; + +type RequestConfig = { + method: string; + path: string; + baseURL?: string | URL; + query?: string; + body?: RequestInit["body"]; + headers?: HeadersInit; + security?: SecurityState | null; +}; + +export class ClientSDK { + private readonly client: HTTPClient; + protected readonly baseURL: URL | null; + protected readonly hooks$: SDKHooks; + + constructor(init: { client: HTTPClient; baseURL: URL | null; hooks: SDKHooks }) { + const url = init.baseURL; + if (url) { + url.pathname = url.pathname.replace(/\/+$/, "") + "/"; + } + + this.hooks$ = init.hooks; + const { baseURL, client } = this.hooks$.sdkInit({ baseURL: url, client: init.client }); + this.baseURL = baseURL; + this.client = client; + } + + protected createRequest$(conf: RequestConfig, options?: RequestOptions) { + const { method, path, query, headers: opHeaders, security } = conf; + + const base = conf.baseURL ?? this.baseURL; + if (!base) { + throw new TypeError("No base URL provided for operation"); + } + const reqURL = new URL(base); + const inputURL = new URL(path, reqURL); + + if (path) { + reqURL.pathname += inputURL.pathname.replace(/^\/+/, ""); + } + + let finalQuery = query || ""; + + const secQuery: string[] = []; + for (const [k, v] of Object.entries(security?.queryParams || {})) { + secQuery.push(encodeForm(k, v, { charEncoding: "percent" })); + } + if (secQuery.length) { + finalQuery += `&${secQuery.join("&")}`; + } + + if (finalQuery) { + const q = finalQuery.startsWith("&") ? finalQuery.slice(1) : finalQuery; + reqURL.search = `?${q}`; + } + + const headers = new Headers(opHeaders); + + const username = security?.basic.username; + const password = security?.basic.password; + if (username != null || password != null) { + const encoded = stringToBase64([username || "", password || ""].join(":")); + headers.set("Authorization", `Basic ${encoded}`); + } + + const securityHeaders = new Headers(security?.headers || {}); + for (const [k, v] of securityHeaders) { + headers.set(k, v); + } + + let cookie = headers.get("cookie") || ""; + for (const [k, v] of Object.entries(security?.cookies || {})) { + cookie += `; ${k}=${v}`; + } + cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie; + headers.set("cookie", cookie); + + const userHeaders = new Headers(options?.fetchOptions?.headers); + for (const [k, v] of userHeaders) { + headers.set(k, v); + } + + return new Request(reqURL, { + ...options?.fetchOptions, + body: conf.body ?? null, + headers, + method, + }); + } + + protected async do$( + req: Request, + options: { + context: HookContext; + errorCodes: number | string | (number | string)[]; + } + ) { + const { context, errorCodes } = options; + + let response = await this.client.request(await this.hooks$.beforeRequest(context, req)); + + if (this.matchStatusCode(response, errorCodes)) { + const result = await this.hooks$.afterError(context, response, null); + if (result.error) { + throw result.error; + } + response = result.response || response; + } else { + response = await this.hooks$.afterSuccess(context, response); + } + + return response; + } + + protected unpackHeaders = unpackHeaders; + + protected matchStatusCode = matchStatusCode; + protected matchResponse = matchResponse; + + protected templateURLComponent = pathToFunc; + + protected resolveSecurity = resolveSecurity; + protected resolveGlobalSecurity = resolveGlobalSecurity; +} diff --git a/typescript/src/lib/security.ts b/typescript/src/lib/security.ts new file mode 100644 index 00000000..d7e1aba2 --- /dev/null +++ b/typescript/src/lib/security.ts @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as components from "../models/components"; + +export enum SecurityErrorCode { + Incomplete = "incomplete", + UnrecognisedSecurityType = "unrecognized_security_type", +} + +export class SecurityError extends Error { + constructor(public code: SecurityErrorCode, message: string) { + super(message); + this.name = "SecurityError"; + } + + static incomplete(): SecurityError { + return new SecurityError( + SecurityErrorCode.Incomplete, + "Security requirements not met in order to perform the operation" + ); + } + static unrecognizedType(type: string): SecurityError { + return new SecurityError( + SecurityErrorCode.UnrecognisedSecurityType, + `Unrecognised security type: ${type}` + ); + } +} + +export type SecurityState = { + basic: { username?: string | undefined; password?: string | undefined }; + headers: Record; + queryParams: Record; + cookies: Record; +}; + +type SecurityInputBasic = { + type: "http:basic"; + value: { username?: string | undefined; password?: string | undefined } | null | undefined; +}; + +type SecurityInputBearer = { + type: "http:bearer"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputAPIKey = { + type: "apiKey:header" | "apiKey:query" | "apiKey:cookie"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputOIDC = { + type: "openIdConnect"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputOAuth2 = { + type: "oauth2"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputOAuth2ClientCredentials = { + type: "oauth2:client_credentials"; + value: string | null | undefined; + fieldName: "clientID" | "clientSecret"; +}; + +export type SecurityInput = + | SecurityInputBasic + | SecurityInputBearer + | SecurityInputAPIKey + | SecurityInputOAuth2 + | SecurityInputOAuth2ClientCredentials + | SecurityInputOIDC; + +export function resolveSecurity(...options: SecurityInput[][]): SecurityState | null { + const state: SecurityState = { + basic: { username: "", password: "" }, + headers: {}, + queryParams: {}, + cookies: {}, + }; + + const option = options.find((opts) => { + return opts.every((o) => { + if (o.value == null) { + return false; + } else if (o.type === "http:basic") { + return o.value.username != null || o.value.password != null; + } else if (typeof o.value === "string") { + return !!o.value; + } else { + throw new Error( + `Unrecognized security type: ${o.type} (value type: ${typeof o.value})` + ); + } + }); + }); + if (option == null) { + return null; + } + + option.forEach((spec) => { + if (spec.value == null) { + return; + } + + const { type } = spec; + + switch (type) { + case "apiKey:header": + state.headers[spec.fieldName] = spec.value; + break; + case "apiKey:query": + state.queryParams[spec.fieldName] = spec.value; + break; + case "apiKey:cookie": + state.cookies[spec.fieldName] = spec.value; + break; + case "http:basic": + applyBasic(state, spec); + break; + case "http:bearer": + applyBearer(state, spec); + break; + case "oauth2": + applyBearer(state, spec); + break; + case "oauth2:client_credentials": + break; + case "openIdConnect": + applyBearer(state, spec); + break; + default: + spec satisfies never; + throw SecurityError.unrecognizedType(type); + } + }); + + return state; +} + +function applyBasic(state: SecurityState, spec: SecurityInputBasic) { + if (spec.value == null) { + return; + } + + state.basic = spec.value; +} + +function applyBearer( + state: SecurityState, + spec: SecurityInputBearer | SecurityInputOAuth2 | SecurityInputOIDC +) { + if (spec.value == null) { + return; + } + + let value = spec.value; + if (value.slice(0, 7).toLowerCase() !== "bearer ") { + value = `Bearer ${value}`; + } + + state.headers[spec.fieldName] = value; +} +export function resolveGlobalSecurity(security: Partial | null | undefined) { + return resolveSecurity([ + { + fieldName: "Authorization", + type: "http:bearer", + value: security?.bearerToken, + }, + ]); +} diff --git a/typescript/src/lib/url.ts b/typescript/src/lib/url.ts new file mode 100644 index 00000000..3fc4eccf --- /dev/null +++ b/typescript/src/lib/url.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +const hasOwn = Object.prototype.hasOwnProperty; + +export function pathToFunc( + pathPattern: string, + options?: { charEncoding?: "percent" | "none" }, +): (params?: Record) => string { + const paramRE = /\{([a-zA-Z0-9_]+?)\}/g; + + return function buildURLPath(params: Record = {}): string { + return pathPattern.replace(paramRE, function (_, placeholder) { + if (!hasOwn.call(params, placeholder)) { + throw new Error(`Parameter '${placeholder}' is required`); + } + + const value = params[placeholder]; + if (typeof value !== "string" && typeof value !== "number") { + throw new Error( + `Parameter '${placeholder}' must be a string or number`, + ); + } + + return options?.charEncoding === "percent" + ? encodeURIComponent(`${value}`) + : `${value}`; + }); + }; +} diff --git a/typescript/src/models/components/index.ts b/typescript/src/models/components/index.ts new file mode 100644 index 00000000..385d40d9 --- /dev/null +++ b/typescript/src/models/components/index.ts @@ -0,0 +1,8 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +export * from "./linkschema"; +export * from "./security"; +export * from "./tagschema"; +export * from "./workspaceschema"; diff --git a/typescript/src/models/components/linkschema.ts b/typescript/src/models/components/linkschema.ts new file mode 100644 index 00000000..e61f3e8e --- /dev/null +++ b/typescript/src/models/components/linkschema.ts @@ -0,0 +1,383 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { TagSchema, TagSchema$ } from "./tagschema"; +import * as z from "zod"; + +export type LinkSchema = { + /** + * The unique ID of the short link. + */ + id: string; + /** + * The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). + */ + domain: string; + /** + * The short link slug. If not provided, a random 7-character slug will be generated. + */ + key: string; + /** + * The destination URL of the short link. + */ + url: string; + /** + * Whether the short link is archived. + */ + archived?: boolean | undefined; + /** + * The date and time when the short link will expire in ISO-8601 format. + */ + expiresAt: Date | null; + /** + * The URL to redirect to when the short link has expired. + */ + expiredUrl: string | null; + /** + * The password required to access the destination URL of the short link. + */ + password: string | null; + /** + * Whether the short link uses Custom Social Media Cards feature. + */ + proxy?: boolean | undefined; + /** + * The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + title: string | null; + /** + * The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + description: string | null; + /** + * The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + image: string | null; + /** + * Whether the short link uses link cloaking. + */ + rewrite?: boolean | undefined; + /** + * The iOS destination URL for the short link for iOS device targeting. + */ + ios: string | null; + /** + * The Android destination URL for the short link for Android device targeting. + */ + android: string | null; + /** + * Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo + */ + geo: Record | null; + /** + * Whether the short link's stats are publicly accessible. + */ + publicStats?: boolean | undefined; + /** + * [DEPRECATED] (use `tags` instead): The unique ID of the tag assigned to the short link. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + tagId: string | null; + /** + * The tags assigned to the short link. + */ + tags: Array | null; + /** + * The comments for the short link. + */ + comments: string | null; + /** + * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). + */ + shortLink: string; + /** + * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). + */ + qrCode: string; + /** + * The UTM source of the short link. + */ + utmSource: string | null; + /** + * The UTM medium of the short link. + */ + utmMedium: string | null; + /** + * The UTM campaign of the short link. + */ + utmCampaign: string | null; + /** + * The UTM term of the short link. + */ + utmTerm: string | null; + /** + * The UTM content of the short link. + */ + utmContent: string | null; + /** + * The user ID of the creator of the short link. + */ + userId: string; + /** + * The workspace ID of the short link. + */ + workspaceId: string; + /** + * The number of clicks on the short link. + */ + clicks?: number | undefined; + /** + * The date and time when the short link was last clicked. + */ + lastClicked: string | null; + /** + * The date and time when the short link was created. + */ + createdAt: string; + /** + * The date and time when the short link was last updated. + */ + updatedAt: string; + /** + * [DEPRECATED] (use workspaceId instead): The project ID of the short link. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + projectId: string; +}; + +/** @internal */ +export namespace LinkSchema$ { + export type Inbound = { + id: string; + domain: string; + key: string; + url: string; + archived?: boolean | undefined; + expiresAt: string | null; + expiredUrl: string | null; + password: string | null; + proxy?: boolean | undefined; + title: string | null; + description: string | null; + image: string | null; + rewrite?: boolean | undefined; + ios: string | null; + android: string | null; + geo: Record | null; + publicStats?: boolean | undefined; + tagId: string | null; + tags: Array | null; + comments: string | null; + shortLink: string; + qrCode: string; + utm_source: string | null; + utm_medium: string | null; + utm_campaign: string | null; + utm_term: string | null; + utm_content: string | null; + userId: string; + workspaceId: string; + clicks?: number | undefined; + lastClicked: string | null; + createdAt: string; + updatedAt: string; + projectId: string; + }; + + export const inboundSchema: z.ZodType = z + .object({ + id: z.string(), + domain: z.string(), + key: z.string(), + url: z.string(), + archived: z.boolean().default(false), + expiresAt: z.nullable( + z + .string() + .datetime({ offset: true }) + .transform((v) => new Date(v)) + ), + expiredUrl: z.nullable(z.string()), + password: z.nullable(z.string()), + proxy: z.boolean().default(false), + title: z.nullable(z.string()), + description: z.nullable(z.string()), + image: z.nullable(z.string()), + rewrite: z.boolean().default(false), + ios: z.nullable(z.string()), + android: z.nullable(z.string()), + geo: z.nullable(z.record(z.string())), + publicStats: z.boolean().default(false), + tagId: z.nullable(z.string()), + tags: z.nullable(z.array(TagSchema$.inboundSchema)), + comments: z.nullable(z.string()), + shortLink: z.string(), + qrCode: z.string(), + utm_source: z.nullable(z.string()), + utm_medium: z.nullable(z.string()), + utm_campaign: z.nullable(z.string()), + utm_term: z.nullable(z.string()), + utm_content: z.nullable(z.string()), + userId: z.string(), + workspaceId: z.string(), + clicks: z.number().default(0), + lastClicked: z.nullable(z.string()), + createdAt: z.string(), + updatedAt: z.string(), + projectId: z.string(), + }) + .transform((v) => { + return { + id: v.id, + domain: v.domain, + key: v.key, + url: v.url, + archived: v.archived, + expiresAt: v.expiresAt, + expiredUrl: v.expiredUrl, + password: v.password, + proxy: v.proxy, + title: v.title, + description: v.description, + image: v.image, + rewrite: v.rewrite, + ios: v.ios, + android: v.android, + geo: v.geo, + publicStats: v.publicStats, + tagId: v.tagId, + tags: v.tags, + comments: v.comments, + shortLink: v.shortLink, + qrCode: v.qrCode, + utmSource: v.utm_source, + utmMedium: v.utm_medium, + utmCampaign: v.utm_campaign, + utmTerm: v.utm_term, + utmContent: v.utm_content, + userId: v.userId, + workspaceId: v.workspaceId, + clicks: v.clicks, + lastClicked: v.lastClicked, + createdAt: v.createdAt, + updatedAt: v.updatedAt, + projectId: v.projectId, + }; + }); + + export type Outbound = { + id: string; + domain: string; + key: string; + url: string; + archived: boolean; + expiresAt: string | null; + expiredUrl: string | null; + password: string | null; + proxy: boolean; + title: string | null; + description: string | null; + image: string | null; + rewrite: boolean; + ios: string | null; + android: string | null; + geo: Record | null; + publicStats: boolean; + tagId: string | null; + tags: Array | null; + comments: string | null; + shortLink: string; + qrCode: string; + utm_source: string | null; + utm_medium: string | null; + utm_campaign: string | null; + utm_term: string | null; + utm_content: string | null; + userId: string; + workspaceId: string; + clicks: number; + lastClicked: string | null; + createdAt: string; + updatedAt: string; + projectId: string; + }; + + export const outboundSchema: z.ZodType = z + .object({ + id: z.string(), + domain: z.string(), + key: z.string(), + url: z.string(), + archived: z.boolean().default(false), + expiresAt: z.nullable(z.date().transform((v) => v.toISOString())), + expiredUrl: z.nullable(z.string()), + password: z.nullable(z.string()), + proxy: z.boolean().default(false), + title: z.nullable(z.string()), + description: z.nullable(z.string()), + image: z.nullable(z.string()), + rewrite: z.boolean().default(false), + ios: z.nullable(z.string()), + android: z.nullable(z.string()), + geo: z.nullable(z.record(z.string())), + publicStats: z.boolean().default(false), + tagId: z.nullable(z.string()), + tags: z.nullable(z.array(TagSchema$.outboundSchema)), + comments: z.nullable(z.string()), + shortLink: z.string(), + qrCode: z.string(), + utmSource: z.nullable(z.string()), + utmMedium: z.nullable(z.string()), + utmCampaign: z.nullable(z.string()), + utmTerm: z.nullable(z.string()), + utmContent: z.nullable(z.string()), + userId: z.string(), + workspaceId: z.string(), + clicks: z.number().default(0), + lastClicked: z.nullable(z.string()), + createdAt: z.string(), + updatedAt: z.string(), + projectId: z.string(), + }) + .transform((v) => { + return { + id: v.id, + domain: v.domain, + key: v.key, + url: v.url, + archived: v.archived, + expiresAt: v.expiresAt, + expiredUrl: v.expiredUrl, + password: v.password, + proxy: v.proxy, + title: v.title, + description: v.description, + image: v.image, + rewrite: v.rewrite, + ios: v.ios, + android: v.android, + geo: v.geo, + publicStats: v.publicStats, + tagId: v.tagId, + tags: v.tags, + comments: v.comments, + shortLink: v.shortLink, + qrCode: v.qrCode, + utm_source: v.utmSource, + utm_medium: v.utmMedium, + utm_campaign: v.utmCampaign, + utm_term: v.utmTerm, + utm_content: v.utmContent, + userId: v.userId, + workspaceId: v.workspaceId, + clicks: v.clicks, + lastClicked: v.lastClicked, + createdAt: v.createdAt, + updatedAt: v.updatedAt, + projectId: v.projectId, + }; + }); +} diff --git a/typescript/src/models/components/security.ts b/typescript/src/models/components/security.ts new file mode 100644 index 00000000..3410f896 --- /dev/null +++ b/typescript/src/models/components/security.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type Security = { + bearerToken?: string | undefined; +}; + +/** @internal */ +export namespace Security$ { + export type Inbound = { + bearerToken?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + bearerToken: z.string().optional(), + }) + .transform((v) => { + return { + ...(v.bearerToken === undefined ? null : { bearerToken: v.bearerToken }), + }; + }); + + export type Outbound = { + bearerToken?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + bearerToken: z.string().optional(), + }) + .transform((v) => { + return { + ...(v.bearerToken === undefined ? null : { bearerToken: v.bearerToken }), + }; + }); +} diff --git a/typescript/src/models/components/tagschema.ts b/typescript/src/models/components/tagschema.ts new file mode 100644 index 00000000..9b01a245 --- /dev/null +++ b/typescript/src/models/components/tagschema.ts @@ -0,0 +1,79 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The color of the tag. + */ +export enum Color { + Red = "red", + Yellow = "yellow", + Green = "green", + Blue = "blue", + Purple = "purple", + Pink = "pink", + Brown = "brown", +} + +export type TagSchema = { + /** + * The unique ID of the tag. + */ + id: string; + /** + * The name of the tag. + */ + name: string; + /** + * The color of the tag. + */ + color: Color; +}; + +/** @internal */ +export const Color$ = z.nativeEnum(Color); + +/** @internal */ +export namespace TagSchema$ { + export type Inbound = { + id: string; + name: string; + color: Color; + }; + + export const inboundSchema: z.ZodType = z + .object({ + id: z.string(), + name: z.string(), + color: Color$, + }) + .transform((v) => { + return { + id: v.id, + name: v.name, + color: v.color, + }; + }); + + export type Outbound = { + id: string; + name: string; + color: Color; + }; + + export const outboundSchema: z.ZodType = z + .object({ + id: z.string(), + name: z.string(), + color: Color$, + }) + .transform((v) => { + return { + id: v.id, + name: v.name, + color: v.color, + }; + }); +} diff --git a/typescript/src/models/components/workspaceschema.ts b/typescript/src/models/components/workspaceschema.ts new file mode 100644 index 00000000..08052f3f --- /dev/null +++ b/typescript/src/models/components/workspaceschema.ts @@ -0,0 +1,306 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The plan of the workspace. + */ +export enum Plan { + Free = "free", + Pro = "pro", + Business = "business", + BusinessPlus = "business plus", + BusinessExtra = "business extra", + BusinessMax = "business max", + Enterprise = "enterprise", +} + +/** + * The role of the authenticated user in the workspace. + */ +export enum Role { + Owner = "owner", + Member = "member", +} + +export type Users = { + /** + * The role of the authenticated user in the workspace. + */ + role: Role; +}; + +export type Domains = { + /** + * The domain of the workspace. + */ + slug: string; +}; + +export type WorkspaceSchema = { + /** + * The unique ID of the workspace. + */ + id: string; + /** + * The name of the workspace. + */ + name: string; + /** + * The slug of the workspace. + */ + slug: string; + /** + * The logo of the workspace. + */ + logo?: string | null | undefined; + /** + * The usage of the workspace. + */ + usage: number; + /** + * The usage limit of the workspace. + */ + usageLimit: number; + /** + * The links usage of the workspace. + */ + linksUsage: number; + /** + * The links limit of the workspace. + */ + linksLimit: number; + /** + * The domains limit of the workspace. + */ + domainsLimit: number; + /** + * The tags limit of the workspace. + */ + tagsLimit: number; + /** + * The users limit of the workspace. + */ + usersLimit: number; + /** + * The plan of the workspace. + */ + plan: Plan; + /** + * The Stripe ID of the workspace. + */ + stripeId: string | null; + /** + * The date and time when the billing cycle starts for the workspace. + */ + billingCycleStart: number; + /** + * The date and time when the workspace was created. + */ + createdAt: string; + /** + * The role of the authenticated user in the workspace. + */ + users: Array; + /** + * The domains of the workspace. + */ + domains: Array; +}; + +/** @internal */ +export const Plan$ = z.nativeEnum(Plan); + +/** @internal */ +export const Role$ = z.nativeEnum(Role); + +/** @internal */ +export namespace Users$ { + export type Inbound = { + role: Role; + }; + + export const inboundSchema: z.ZodType = z + .object({ + role: Role$, + }) + .transform((v) => { + return { + role: v.role, + }; + }); + + export type Outbound = { + role: Role; + }; + + export const outboundSchema: z.ZodType = z + .object({ + role: Role$, + }) + .transform((v) => { + return { + role: v.role, + }; + }); +} + +/** @internal */ +export namespace Domains$ { + export type Inbound = { + slug: string; + }; + + export const inboundSchema: z.ZodType = z + .object({ + slug: z.string(), + }) + .transform((v) => { + return { + slug: v.slug, + }; + }); + + export type Outbound = { + slug: string; + }; + + export const outboundSchema: z.ZodType = z + .object({ + slug: z.string(), + }) + .transform((v) => { + return { + slug: v.slug, + }; + }); +} + +/** @internal */ +export namespace WorkspaceSchema$ { + export type Inbound = { + id: string; + name: string; + slug: string; + logo?: string | null | undefined; + usage: number; + usageLimit: number; + linksUsage: number; + linksLimit: number; + domainsLimit: number; + tagsLimit: number; + usersLimit: number; + plan: Plan; + stripeId: string | null; + billingCycleStart: number; + createdAt: string; + users: Array; + domains: Array; + }; + + export const inboundSchema: z.ZodType = z + .object({ + id: z.string(), + name: z.string(), + slug: z.string(), + logo: z.nullable(z.string()).default(null), + usage: z.number(), + usageLimit: z.number(), + linksUsage: z.number(), + linksLimit: z.number(), + domainsLimit: z.number(), + tagsLimit: z.number(), + usersLimit: z.number(), + plan: Plan$, + stripeId: z.nullable(z.string()), + billingCycleStart: z.number(), + createdAt: z.string(), + users: z.array(z.lazy(() => Users$.inboundSchema)), + domains: z.array(z.lazy(() => Domains$.inboundSchema)), + }) + .transform((v) => { + return { + id: v.id, + name: v.name, + slug: v.slug, + logo: v.logo, + usage: v.usage, + usageLimit: v.usageLimit, + linksUsage: v.linksUsage, + linksLimit: v.linksLimit, + domainsLimit: v.domainsLimit, + tagsLimit: v.tagsLimit, + usersLimit: v.usersLimit, + plan: v.plan, + stripeId: v.stripeId, + billingCycleStart: v.billingCycleStart, + createdAt: v.createdAt, + users: v.users, + domains: v.domains, + }; + }); + + export type Outbound = { + id: string; + name: string; + slug: string; + logo: string | null; + usage: number; + usageLimit: number; + linksUsage: number; + linksLimit: number; + domainsLimit: number; + tagsLimit: number; + usersLimit: number; + plan: Plan; + stripeId: string | null; + billingCycleStart: number; + createdAt: string; + users: Array; + domains: Array; + }; + + export const outboundSchema: z.ZodType = z + .object({ + id: z.string(), + name: z.string(), + slug: z.string(), + logo: z.nullable(z.string()).default(null), + usage: z.number(), + usageLimit: z.number(), + linksUsage: z.number(), + linksLimit: z.number(), + domainsLimit: z.number(), + tagsLimit: z.number(), + usersLimit: z.number(), + plan: Plan$, + stripeId: z.nullable(z.string()), + billingCycleStart: z.number(), + createdAt: z.string(), + users: z.array(z.lazy(() => Users$.outboundSchema)), + domains: z.array(z.lazy(() => Domains$.outboundSchema)), + }) + .transform((v) => { + return { + id: v.id, + name: v.name, + slug: v.slug, + logo: v.logo, + usage: v.usage, + usageLimit: v.usageLimit, + linksUsage: v.linksUsage, + linksLimit: v.linksLimit, + domainsLimit: v.domainsLimit, + tagsLimit: v.tagsLimit, + usersLimit: v.usersLimit, + plan: v.plan, + stripeId: v.stripeId, + billingCycleStart: v.billingCycleStart, + createdAt: v.createdAt, + users: v.users, + domains: v.domains, + }; + }); +} diff --git a/typescript/src/models/errors/badrequest.ts b/typescript/src/models/errors/badrequest.ts new file mode 100644 index 00000000..3aba935c --- /dev/null +++ b/typescript/src/models/errors/badrequest.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum Code { + BadRequest = "bad_request", +} + +export type ErrorT = { + /** + * A short code indicating the error code returned. + */ + code: Code; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). + */ +export type BadRequestData = { + error: ErrorT; +}; + +/** + * The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). + */ +export class BadRequest extends Error { + error: ErrorT; + + /** The original data that was passed to this error instance. */ + data$: BadRequestData; + + constructor(err: BadRequestData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "BadRequest"; + } +} + +/** @internal */ +export const Code$ = z.nativeEnum(Code); + +/** @internal */ +export namespace ErrorT$ { + export type Inbound = { + code: Code; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: Code$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: Code; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: Code$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace BadRequest$ { + export type Inbound = { + error: ErrorT$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => ErrorT$.inboundSchema), + }) + .transform((v) => { + return new BadRequest({ + error: v.error, + }); + }); + + export type Outbound = { + error: ErrorT$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(BadRequest) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => ErrorT$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/conflict.ts b/typescript/src/models/errors/conflict.ts new file mode 100644 index 00000000..1f87066d --- /dev/null +++ b/typescript/src/models/errors/conflict.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum ConflictCode { + Conflict = "conflict", +} + +export type ConflictError = { + /** + * A short code indicating the error code returned. + */ + code: ConflictCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * This response is sent when a request conflicts with the current state of the server. + */ +export type ConflictData = { + error: ConflictError; +}; + +/** + * This response is sent when a request conflicts with the current state of the server. + */ +export class Conflict extends Error { + error: ConflictError; + + /** The original data that was passed to this error instance. */ + data$: ConflictData; + + constructor(err: ConflictData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "Conflict"; + } +} + +/** @internal */ +export const ConflictCode$ = z.nativeEnum(ConflictCode); + +/** @internal */ +export namespace ConflictError$ { + export type Inbound = { + code: ConflictCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: ConflictCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: ConflictCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: ConflictCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace Conflict$ { + export type Inbound = { + error: ConflictError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => ConflictError$.inboundSchema), + }) + .transform((v) => { + return new Conflict({ + error: v.error, + }); + }); + + export type Outbound = { + error: ConflictError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(Conflict) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => ConflictError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/fivehundred.ts b/typescript/src/models/errors/fivehundred.ts new file mode 100644 index 00000000..3310428d --- /dev/null +++ b/typescript/src/models/errors/fivehundred.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum FiveHundredCode { + InternalServerError = "internal_server_error", +} + +export type FiveHundredError = { + /** + * A short code indicating the error code returned. + */ + code: FiveHundredCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The server has encountered a situation it does not know how to handle. + */ +export type FiveHundredData = { + error: FiveHundredError; +}; + +/** + * The server has encountered a situation it does not know how to handle. + */ +export class FiveHundred extends Error { + error: FiveHundredError; + + /** The original data that was passed to this error instance. */ + data$: FiveHundredData; + + constructor(err: FiveHundredData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "FiveHundred"; + } +} + +/** @internal */ +export const FiveHundredCode$ = z.nativeEnum(FiveHundredCode); + +/** @internal */ +export namespace FiveHundredError$ { + export type Inbound = { + code: FiveHundredCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: FiveHundredCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: FiveHundredCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: FiveHundredCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace FiveHundred$ { + export type Inbound = { + error: FiveHundredError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => FiveHundredError$.inboundSchema), + }) + .transform((v) => { + return new FiveHundred({ + error: v.error, + }); + }); + + export type Outbound = { + error: FiveHundredError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(FiveHundred) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => FiveHundredError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/forbidden.ts b/typescript/src/models/errors/forbidden.ts new file mode 100644 index 00000000..8a0537f0 --- /dev/null +++ b/typescript/src/models/errors/forbidden.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum ForbiddenCode { + Forbidden = "forbidden", +} + +export type ForbiddenError = { + /** + * A short code indicating the error code returned. + */ + code: ForbiddenCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. + */ +export type ForbiddenData = { + error: ForbiddenError; +}; + +/** + * The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. + */ +export class Forbidden extends Error { + error: ForbiddenError; + + /** The original data that was passed to this error instance. */ + data$: ForbiddenData; + + constructor(err: ForbiddenData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "Forbidden"; + } +} + +/** @internal */ +export const ForbiddenCode$ = z.nativeEnum(ForbiddenCode); + +/** @internal */ +export namespace ForbiddenError$ { + export type Inbound = { + code: ForbiddenCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: ForbiddenCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: ForbiddenCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: ForbiddenCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace Forbidden$ { + export type Inbound = { + error: ForbiddenError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => ForbiddenError$.inboundSchema), + }) + .transform((v) => { + return new Forbidden({ + error: v.error, + }); + }); + + export type Outbound = { + error: ForbiddenError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(Forbidden) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => ForbiddenError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/fourhundred.ts b/typescript/src/models/errors/fourhundred.ts new file mode 100644 index 00000000..7794225e --- /dev/null +++ b/typescript/src/models/errors/fourhundred.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum Code { + BadRequest = "bad_request", +} + +export type ErrorT = { + /** + * A short code indicating the error code returned. + */ + code: Code; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). + */ +export type FourHundredData = { + error: ErrorT; +}; + +/** + * The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). + */ +export class FourHundred extends Error { + error: ErrorT; + + /** The original data that was passed to this error instance. */ + data$: FourHundredData; + + constructor(err: FourHundredData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "FourHundred"; + } +} + +/** @internal */ +export const Code$ = z.nativeEnum(Code); + +/** @internal */ +export namespace ErrorT$ { + export type Inbound = { + code: Code; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: Code$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: Code; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: Code$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace FourHundred$ { + export type Inbound = { + error: ErrorT$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => ErrorT$.inboundSchema), + }) + .transform((v) => { + return new FourHundred({ + error: v.error, + }); + }); + + export type Outbound = { + error: ErrorT$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(FourHundred) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => ErrorT$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/fourhundredandfour.ts b/typescript/src/models/errors/fourhundredandfour.ts new file mode 100644 index 00000000..bf636dff --- /dev/null +++ b/typescript/src/models/errors/fourhundredandfour.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum FourHundredAndFourCode { + NotFound = "not_found", +} + +export type FourHundredAndFourError = { + /** + * A short code indicating the error code returned. + */ + code: FourHundredAndFourCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The server cannot find the requested resource. + */ +export type FourHundredAndFourData = { + error: FourHundredAndFourError; +}; + +/** + * The server cannot find the requested resource. + */ +export class FourHundredAndFour extends Error { + error: FourHundredAndFourError; + + /** The original data that was passed to this error instance. */ + data$: FourHundredAndFourData; + + constructor(err: FourHundredAndFourData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "FourHundredAndFour"; + } +} + +/** @internal */ +export const FourHundredAndFourCode$ = z.nativeEnum(FourHundredAndFourCode); + +/** @internal */ +export namespace FourHundredAndFourError$ { + export type Inbound = { + code: FourHundredAndFourCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: FourHundredAndFourCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: FourHundredAndFourCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: FourHundredAndFourCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace FourHundredAndFour$ { + export type Inbound = { + error: FourHundredAndFourError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => FourHundredAndFourError$.inboundSchema), + }) + .transform((v) => { + return new FourHundredAndFour({ + error: v.error, + }); + }); + + export type Outbound = { + error: FourHundredAndFourError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(FourHundredAndFour) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => FourHundredAndFourError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/fourhundredandnine.ts b/typescript/src/models/errors/fourhundredandnine.ts new file mode 100644 index 00000000..5be2f7da --- /dev/null +++ b/typescript/src/models/errors/fourhundredandnine.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum FourHundredAndNineCode { + Conflict = "conflict", +} + +export type FourHundredAndNineError = { + /** + * A short code indicating the error code returned. + */ + code: FourHundredAndNineCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * This response is sent when a request conflicts with the current state of the server. + */ +export type FourHundredAndNineData = { + error: FourHundredAndNineError; +}; + +/** + * This response is sent when a request conflicts with the current state of the server. + */ +export class FourHundredAndNine extends Error { + error: FourHundredAndNineError; + + /** The original data that was passed to this error instance. */ + data$: FourHundredAndNineData; + + constructor(err: FourHundredAndNineData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "FourHundredAndNine"; + } +} + +/** @internal */ +export const FourHundredAndNineCode$ = z.nativeEnum(FourHundredAndNineCode); + +/** @internal */ +export namespace FourHundredAndNineError$ { + export type Inbound = { + code: FourHundredAndNineCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: FourHundredAndNineCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: FourHundredAndNineCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: FourHundredAndNineCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace FourHundredAndNine$ { + export type Inbound = { + error: FourHundredAndNineError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => FourHundredAndNineError$.inboundSchema), + }) + .transform((v) => { + return new FourHundredAndNine({ + error: v.error, + }); + }); + + export type Outbound = { + error: FourHundredAndNineError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(FourHundredAndNine) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => FourHundredAndNineError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/fourhundredandone.ts b/typescript/src/models/errors/fourhundredandone.ts new file mode 100644 index 00000000..277f5eee --- /dev/null +++ b/typescript/src/models/errors/fourhundredandone.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum FourHundredAndOneCode { + Unauthorized = "unauthorized", +} + +export type FourHundredAndOneError = { + /** + * A short code indicating the error code returned. + */ + code: FourHundredAndOneCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. + */ +export type FourHundredAndOneData = { + error: FourHundredAndOneError; +}; + +/** + * Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. + */ +export class FourHundredAndOne extends Error { + error: FourHundredAndOneError; + + /** The original data that was passed to this error instance. */ + data$: FourHundredAndOneData; + + constructor(err: FourHundredAndOneData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "FourHundredAndOne"; + } +} + +/** @internal */ +export const FourHundredAndOneCode$ = z.nativeEnum(FourHundredAndOneCode); + +/** @internal */ +export namespace FourHundredAndOneError$ { + export type Inbound = { + code: FourHundredAndOneCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: FourHundredAndOneCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: FourHundredAndOneCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: FourHundredAndOneCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace FourHundredAndOne$ { + export type Inbound = { + error: FourHundredAndOneError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => FourHundredAndOneError$.inboundSchema), + }) + .transform((v) => { + return new FourHundredAndOne({ + error: v.error, + }); + }); + + export type Outbound = { + error: FourHundredAndOneError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(FourHundredAndOne) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => FourHundredAndOneError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/fourhundredandten.ts b/typescript/src/models/errors/fourhundredandten.ts new file mode 100644 index 00000000..c3a8a66d --- /dev/null +++ b/typescript/src/models/errors/fourhundredandten.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum FourHundredAndTenCode { + InviteExpired = "invite_expired", +} + +export type FourHundredAndTenError = { + /** + * A short code indicating the error code returned. + */ + code: FourHundredAndTenCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * This response is sent when the requested content has been permanently deleted from server, with no forwarding address. + */ +export type FourHundredAndTenData = { + error: FourHundredAndTenError; +}; + +/** + * This response is sent when the requested content has been permanently deleted from server, with no forwarding address. + */ +export class FourHundredAndTen extends Error { + error: FourHundredAndTenError; + + /** The original data that was passed to this error instance. */ + data$: FourHundredAndTenData; + + constructor(err: FourHundredAndTenData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "FourHundredAndTen"; + } +} + +/** @internal */ +export const FourHundredAndTenCode$ = z.nativeEnum(FourHundredAndTenCode); + +/** @internal */ +export namespace FourHundredAndTenError$ { + export type Inbound = { + code: FourHundredAndTenCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: FourHundredAndTenCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: FourHundredAndTenCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: FourHundredAndTenCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace FourHundredAndTen$ { + export type Inbound = { + error: FourHundredAndTenError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => FourHundredAndTenError$.inboundSchema), + }) + .transform((v) => { + return new FourHundredAndTen({ + error: v.error, + }); + }); + + export type Outbound = { + error: FourHundredAndTenError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(FourHundredAndTen) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => FourHundredAndTenError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/fourhundredandthree.ts b/typescript/src/models/errors/fourhundredandthree.ts new file mode 100644 index 00000000..8f719040 --- /dev/null +++ b/typescript/src/models/errors/fourhundredandthree.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum FourHundredAndThreeCode { + Forbidden = "forbidden", +} + +export type FourHundredAndThreeError = { + /** + * A short code indicating the error code returned. + */ + code: FourHundredAndThreeCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. + */ +export type FourHundredAndThreeData = { + error: FourHundredAndThreeError; +}; + +/** + * The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. + */ +export class FourHundredAndThree extends Error { + error: FourHundredAndThreeError; + + /** The original data that was passed to this error instance. */ + data$: FourHundredAndThreeData; + + constructor(err: FourHundredAndThreeData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "FourHundredAndThree"; + } +} + +/** @internal */ +export const FourHundredAndThreeCode$ = z.nativeEnum(FourHundredAndThreeCode); + +/** @internal */ +export namespace FourHundredAndThreeError$ { + export type Inbound = { + code: FourHundredAndThreeCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: FourHundredAndThreeCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: FourHundredAndThreeCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: FourHundredAndThreeCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace FourHundredAndThree$ { + export type Inbound = { + error: FourHundredAndThreeError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => FourHundredAndThreeError$.inboundSchema), + }) + .transform((v) => { + return new FourHundredAndThree({ + error: v.error, + }); + }); + + export type Outbound = { + error: FourHundredAndThreeError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(FourHundredAndThree) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => FourHundredAndThreeError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/fourhundredandtwentynine.ts b/typescript/src/models/errors/fourhundredandtwentynine.ts new file mode 100644 index 00000000..09a72883 --- /dev/null +++ b/typescript/src/models/errors/fourhundredandtwentynine.ts @@ -0,0 +1,141 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum FourHundredAndTwentyNineCode { + RateLimitExceeded = "rate_limit_exceeded", +} + +export type FourHundredAndTwentyNineError = { + /** + * A short code indicating the error code returned. + */ + code: FourHundredAndTwentyNineCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The user has sent too many requests in a given amount of time ("rate limiting") + */ +export type FourHundredAndTwentyNineData = { + error: FourHundredAndTwentyNineError; +}; + +/** + * The user has sent too many requests in a given amount of time ("rate limiting") + */ +export class FourHundredAndTwentyNine extends Error { + error: FourHundredAndTwentyNineError; + + /** The original data that was passed to this error instance. */ + data$: FourHundredAndTwentyNineData; + + constructor(err: FourHundredAndTwentyNineData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "FourHundredAndTwentyNine"; + } +} + +/** @internal */ +export const FourHundredAndTwentyNineCode$ = z.nativeEnum(FourHundredAndTwentyNineCode); + +/** @internal */ +export namespace FourHundredAndTwentyNineError$ { + export type Inbound = { + code: FourHundredAndTwentyNineCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: FourHundredAndTwentyNineCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: FourHundredAndTwentyNineCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = + z + .object({ + code: FourHundredAndTwentyNineCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace FourHundredAndTwentyNine$ { + export type Inbound = { + error: FourHundredAndTwentyNineError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => FourHundredAndTwentyNineError$.inboundSchema), + }) + .transform((v) => { + return new FourHundredAndTwentyNine({ + error: v.error, + }); + }); + + export type Outbound = { + error: FourHundredAndTwentyNineError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(FourHundredAndTwentyNine) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => FourHundredAndTwentyNineError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/fourhundredandtwentytwo.ts b/typescript/src/models/errors/fourhundredandtwentytwo.ts new file mode 100644 index 00000000..0c7d9ba0 --- /dev/null +++ b/typescript/src/models/errors/fourhundredandtwentytwo.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum FourHundredAndTwentyTwoCode { + UnprocessableEntity = "unprocessable_entity", +} + +export type FourHundredAndTwentyTwoError = { + /** + * A short code indicating the error code returned. + */ + code: FourHundredAndTwentyTwoCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The request was well-formed but was unable to be followed due to semantic errors. + */ +export type FourHundredAndTwentyTwoData = { + error: FourHundredAndTwentyTwoError; +}; + +/** + * The request was well-formed but was unable to be followed due to semantic errors. + */ +export class FourHundredAndTwentyTwo extends Error { + error: FourHundredAndTwentyTwoError; + + /** The original data that was passed to this error instance. */ + data$: FourHundredAndTwentyTwoData; + + constructor(err: FourHundredAndTwentyTwoData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "FourHundredAndTwentyTwo"; + } +} + +/** @internal */ +export const FourHundredAndTwentyTwoCode$ = z.nativeEnum(FourHundredAndTwentyTwoCode); + +/** @internal */ +export namespace FourHundredAndTwentyTwoError$ { + export type Inbound = { + code: FourHundredAndTwentyTwoCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: FourHundredAndTwentyTwoCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: FourHundredAndTwentyTwoCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: FourHundredAndTwentyTwoCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace FourHundredAndTwentyTwo$ { + export type Inbound = { + error: FourHundredAndTwentyTwoError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => FourHundredAndTwentyTwoError$.inboundSchema), + }) + .transform((v) => { + return new FourHundredAndTwentyTwo({ + error: v.error, + }); + }); + + export type Outbound = { + error: FourHundredAndTwentyTwoError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(FourHundredAndTwentyTwo) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => FourHundredAndTwentyTwoError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/index.ts b/typescript/src/models/errors/index.ts new file mode 100644 index 00000000..e7ef3298 --- /dev/null +++ b/typescript/src/models/errors/index.ts @@ -0,0 +1,15 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +export * from "./fivehundred"; +export * from "./fourhundred"; +export * from "./fourhundredandfour"; +export * from "./fourhundredandnine"; +export * from "./fourhundredandone"; +export * from "./fourhundredandten"; +export * from "./fourhundredandthree"; +export * from "./fourhundredandtwentynine"; +export * from "./fourhundredandtwentytwo"; +export * from "./sdkerror"; +export * from "./sdkvalidationerror"; diff --git a/typescript/src/models/errors/internalservererror.ts b/typescript/src/models/errors/internalservererror.ts new file mode 100644 index 00000000..42208725 --- /dev/null +++ b/typescript/src/models/errors/internalservererror.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum InternalServerErrorCode { + InternalServerError = "internal_server_error", +} + +export type InternalServerErrorError = { + /** + * A short code indicating the error code returned. + */ + code: InternalServerErrorCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The server has encountered a situation it does not know how to handle. + */ +export type InternalServerErrorData = { + error: InternalServerErrorError; +}; + +/** + * The server has encountered a situation it does not know how to handle. + */ +export class InternalServerError extends Error { + error: InternalServerErrorError; + + /** The original data that was passed to this error instance. */ + data$: InternalServerErrorData; + + constructor(err: InternalServerErrorData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "InternalServerError"; + } +} + +/** @internal */ +export const InternalServerErrorCode$ = z.nativeEnum(InternalServerErrorCode); + +/** @internal */ +export namespace InternalServerErrorError$ { + export type Inbound = { + code: InternalServerErrorCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: InternalServerErrorCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: InternalServerErrorCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: InternalServerErrorCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace InternalServerError$ { + export type Inbound = { + error: InternalServerErrorError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => InternalServerErrorError$.inboundSchema), + }) + .transform((v) => { + return new InternalServerError({ + error: v.error, + }); + }); + + export type Outbound = { + error: InternalServerErrorError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(InternalServerError) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => InternalServerErrorError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/inviteexpired.ts b/typescript/src/models/errors/inviteexpired.ts new file mode 100644 index 00000000..5e43369c --- /dev/null +++ b/typescript/src/models/errors/inviteexpired.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum InviteExpiredCode { + InviteExpired = "invite_expired", +} + +export type InviteExpiredError = { + /** + * A short code indicating the error code returned. + */ + code: InviteExpiredCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * This response is sent when the requested content has been permanently deleted from server, with no forwarding address. + */ +export type InviteExpiredData = { + error: InviteExpiredError; +}; + +/** + * This response is sent when the requested content has been permanently deleted from server, with no forwarding address. + */ +export class InviteExpired extends Error { + error: InviteExpiredError; + + /** The original data that was passed to this error instance. */ + data$: InviteExpiredData; + + constructor(err: InviteExpiredData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "InviteExpired"; + } +} + +/** @internal */ +export const InviteExpiredCode$ = z.nativeEnum(InviteExpiredCode); + +/** @internal */ +export namespace InviteExpiredError$ { + export type Inbound = { + code: InviteExpiredCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: InviteExpiredCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: InviteExpiredCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: InviteExpiredCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace InviteExpired$ { + export type Inbound = { + error: InviteExpiredError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => InviteExpiredError$.inboundSchema), + }) + .transform((v) => { + return new InviteExpired({ + error: v.error, + }); + }); + + export type Outbound = { + error: InviteExpiredError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(InviteExpired) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => InviteExpiredError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/notfound.ts b/typescript/src/models/errors/notfound.ts new file mode 100644 index 00000000..5fe03b13 --- /dev/null +++ b/typescript/src/models/errors/notfound.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum NotFoundCode { + NotFound = "not_found", +} + +export type NotFoundError = { + /** + * A short code indicating the error code returned. + */ + code: NotFoundCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The server cannot find the requested resource. + */ +export type NotFoundData = { + error: NotFoundError; +}; + +/** + * The server cannot find the requested resource. + */ +export class NotFound extends Error { + error: NotFoundError; + + /** The original data that was passed to this error instance. */ + data$: NotFoundData; + + constructor(err: NotFoundData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "NotFound"; + } +} + +/** @internal */ +export const NotFoundCode$ = z.nativeEnum(NotFoundCode); + +/** @internal */ +export namespace NotFoundError$ { + export type Inbound = { + code: NotFoundCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: NotFoundCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: NotFoundCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: NotFoundCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace NotFound$ { + export type Inbound = { + error: NotFoundError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => NotFoundError$.inboundSchema), + }) + .transform((v) => { + return new NotFound({ + error: v.error, + }); + }); + + export type Outbound = { + error: NotFoundError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(NotFound) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => NotFoundError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/ratelimitexceeded.ts b/typescript/src/models/errors/ratelimitexceeded.ts new file mode 100644 index 00000000..99d349a4 --- /dev/null +++ b/typescript/src/models/errors/ratelimitexceeded.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum RateLimitExceededCode { + RateLimitExceeded = "rate_limit_exceeded", +} + +export type RateLimitExceededError = { + /** + * A short code indicating the error code returned. + */ + code: RateLimitExceededCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The user has sent too many requests in a given amount of time ("rate limiting") + */ +export type RateLimitExceededData = { + error: RateLimitExceededError; +}; + +/** + * The user has sent too many requests in a given amount of time ("rate limiting") + */ +export class RateLimitExceeded extends Error { + error: RateLimitExceededError; + + /** The original data that was passed to this error instance. */ + data$: RateLimitExceededData; + + constructor(err: RateLimitExceededData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "RateLimitExceeded"; + } +} + +/** @internal */ +export const RateLimitExceededCode$ = z.nativeEnum(RateLimitExceededCode); + +/** @internal */ +export namespace RateLimitExceededError$ { + export type Inbound = { + code: RateLimitExceededCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: RateLimitExceededCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: RateLimitExceededCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: RateLimitExceededCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace RateLimitExceeded$ { + export type Inbound = { + error: RateLimitExceededError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => RateLimitExceededError$.inboundSchema), + }) + .transform((v) => { + return new RateLimitExceeded({ + error: v.error, + }); + }); + + export type Outbound = { + error: RateLimitExceededError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(RateLimitExceeded) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => RateLimitExceededError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/sdkerror.ts b/typescript/src/models/errors/sdkerror.ts new file mode 100644 index 00000000..1f66915b --- /dev/null +++ b/typescript/src/models/errors/sdkerror.ts @@ -0,0 +1,22 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +export class SDKError extends Error { + public readonly statusCode: number; + + constructor( + message: string, + public readonly rawResponse: Response, + public readonly body: string = "" + ) { + const statusCode = rawResponse.status; + const bodyString = body.length > 0 ? `\n${body}` : ""; + + super(`${message}: Status ${statusCode}${bodyString}`); + + this.statusCode = statusCode; + + this.name = "SDKError"; + } +} diff --git a/typescript/src/models/errors/sdkvalidationerror.ts b/typescript/src/models/errors/sdkvalidationerror.ts new file mode 100644 index 00000000..fe38e772 --- /dev/null +++ b/typescript/src/models/errors/sdkvalidationerror.ts @@ -0,0 +1,95 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +export class SDKValidationError extends Error { + /** + * The raw value that failed validation. + */ + public readonly rawValue: unknown; + + constructor(message: string, cause: unknown, rawValue: unknown) { + super(message); + this.name = "SDKValidationError"; + this.cause = cause; + this.rawValue = rawValue; + } + + public override toString() { + return `${this.message}: ${this.cause}`; + } + + /** + * Return a pretty-formatted error message if the underlying validation error + * is a ZodError or some other recognized error type, otherwise return the + * default error message. + */ + public pretty() { + if (this.cause instanceof z.ZodError) { + return `${this.message}\n${formatZodError(this.cause)}`; + } else { + return this.toString(); + } + } +} + +export function formatZodError(err: z.ZodError, level = 0): string { + let pre = " ".repeat(level); + pre = level > 0 ? `│${pre}` : pre; + pre += " ".repeat(level); + + let message = ""; + const append = (str: string) => (message += `\n${pre}${str}`); + + const len = err.issues.length; + const headline = len === 1 ? `${len} issue found` : `${len} issues found`; + + if (len) { + append(`┌ ${headline}:`); + } + + for (const issue of err.issues) { + let path = issue.path.join("."); + path = path ? `.${path}` : ""; + append(`│ • [${path}]: ${issue.message} (${issue.code})`); + switch (issue.code) { + case "invalid_literal": + case "invalid_type": { + append(`│ Want: ${issue.expected}`); + append(`│ Got: ${issue.received}`); + break; + } + case "unrecognized_keys": { + append(`│ Keys: ${issue.keys.join(", ")}`); + break; + } + case "invalid_enum_value": { + append(`│ Allowed: ${issue.options.join(", ")}`); + append(`│ Got: ${issue.received}`); + break; + } + case "invalid_union_discriminator": { + append(`│ Allowed: ${issue.options.join(", ")}`); + break; + } + case "invalid_union": { + const len = issue.unionErrors.length; + append( + `│ ✖︎ Attemped to deserialize into one of ${len} union members:`, + ); + issue.unionErrors.forEach((err, i) => { + append(`│ ✖︎ Member ${i + 1} of ${len}`); + append(`${formatZodError(err, level + 1)}`); + }); + } + } + } + + if (err.issues.length) { + append(`└─*`); + } + + return message.slice(1); +} diff --git a/typescript/src/models/errors/unauthorized.ts b/typescript/src/models/errors/unauthorized.ts new file mode 100644 index 00000000..d9622daf --- /dev/null +++ b/typescript/src/models/errors/unauthorized.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum UnauthorizedCode { + Unauthorized = "unauthorized", +} + +export type UnauthorizedError = { + /** + * A short code indicating the error code returned. + */ + code: UnauthorizedCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. + */ +export type UnauthorizedData = { + error: UnauthorizedError; +}; + +/** + * Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. + */ +export class Unauthorized extends Error { + error: UnauthorizedError; + + /** The original data that was passed to this error instance. */ + data$: UnauthorizedData; + + constructor(err: UnauthorizedData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "Unauthorized"; + } +} + +/** @internal */ +export const UnauthorizedCode$ = z.nativeEnum(UnauthorizedCode); + +/** @internal */ +export namespace UnauthorizedError$ { + export type Inbound = { + code: UnauthorizedCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: UnauthorizedCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: UnauthorizedCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: UnauthorizedCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace Unauthorized$ { + export type Inbound = { + error: UnauthorizedError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => UnauthorizedError$.inboundSchema), + }) + .transform((v) => { + return new Unauthorized({ + error: v.error, + }); + }); + + export type Outbound = { + error: UnauthorizedError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(Unauthorized) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => UnauthorizedError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/errors/unprocessableentity.ts b/typescript/src/models/errors/unprocessableentity.ts new file mode 100644 index 00000000..117bc7a9 --- /dev/null +++ b/typescript/src/models/errors/unprocessableentity.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * A short code indicating the error code returned. + */ +export enum UnprocessableEntityCode { + UnprocessableEntity = "unprocessable_entity", +} + +export type UnprocessableEntityError = { + /** + * A short code indicating the error code returned. + */ + code: UnprocessableEntityCode; + /** + * A human readable explanation of what went wrong. + */ + message: string; + /** + * A link to our documentation with more details about this error code + */ + docUrl?: string | undefined; +}; + +/** + * The request was well-formed but was unable to be followed due to semantic errors. + */ +export type UnprocessableEntityData = { + error: UnprocessableEntityError; +}; + +/** + * The request was well-formed but was unable to be followed due to semantic errors. + */ +export class UnprocessableEntity extends Error { + error: UnprocessableEntityError; + + /** The original data that was passed to this error instance. */ + data$: UnprocessableEntityData; + + constructor(err: UnprocessableEntityData) { + super(""); + this.data$ = err; + + this.error = err.error; + + this.message = + "message" in err && typeof err.message === "string" + ? err.message + : "API error occurred"; + + this.name = "UnprocessableEntity"; + } +} + +/** @internal */ +export const UnprocessableEntityCode$ = z.nativeEnum(UnprocessableEntityCode); + +/** @internal */ +export namespace UnprocessableEntityError$ { + export type Inbound = { + code: UnprocessableEntityCode; + message: string; + doc_url?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + code: UnprocessableEntityCode$, + message: z.string(), + doc_url: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.doc_url === undefined ? null : { docUrl: v.doc_url }), + }; + }); + + export type Outbound = { + code: UnprocessableEntityCode; + message: string; + doc_url?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + code: UnprocessableEntityCode$, + message: z.string(), + docUrl: z.string().optional(), + }) + .transform((v) => { + return { + code: v.code, + message: v.message, + ...(v.docUrl === undefined ? null : { doc_url: v.docUrl }), + }; + }); +} + +/** @internal */ +export namespace UnprocessableEntity$ { + export type Inbound = { + error: UnprocessableEntityError$.Inbound; + }; + + export const inboundSchema: z.ZodType = z + .object({ + error: z.lazy(() => UnprocessableEntityError$.inboundSchema), + }) + .transform((v) => { + return new UnprocessableEntity({ + error: v.error, + }); + }); + + export type Outbound = { + error: UnprocessableEntityError$.Outbound; + }; + + export const outboundSchema: z.ZodType = z + .instanceof(UnprocessableEntity) + .transform((v) => v.data$) + .pipe( + z + .object({ + error: z.lazy(() => UnprocessableEntityError$.outboundSchema), + }) + .transform((v) => { + return { + error: v.error, + }; + }) + ); +} diff --git a/typescript/src/models/operations/bulkcreatelinks.ts b/typescript/src/models/operations/bulkcreatelinks.ts new file mode 100644 index 00000000..1e4e7737 --- /dev/null +++ b/typescript/src/models/operations/bulkcreatelinks.ts @@ -0,0 +1,299 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The unique IDs of the tags assigned to the short link. + */ +export type BulkCreateLinksTagIds = string | Array; + +export type RequestBody = { + /** + * The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). + */ + domain?: string | undefined; + /** + * The short link slug. If not provided, a random 7-character slug will be generated. + */ + key?: string | undefined; + /** + * The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. + */ + prefix?: string | undefined; + /** + * The destination URL of the short link. + */ + url: string; + /** + * Whether the short link is archived. + */ + archived?: boolean | undefined; + /** + * The date and time when the short link will expire at. + */ + expiresAt?: string | null | undefined; + /** + * The URL to redirect to when the short link has expired. + */ + expiredUrl?: string | null | undefined; + /** + * The password required to access the destination URL of the short link. + */ + password?: string | null | undefined; + /** + * Whether the short link uses Custom Social Media Cards feature. + */ + proxy?: boolean | undefined; + /** + * The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + title?: string | null | undefined; + /** + * The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + description?: string | null | undefined; + /** + * The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + image?: string | null | undefined; + /** + * Whether the short link uses link cloaking. + */ + rewrite?: boolean | undefined; + /** + * The iOS destination URL for the short link for iOS device targeting. + */ + ios?: string | null | undefined; + /** + * The Android destination URL for the short link for Android device targeting. + */ + android?: string | null | undefined; + /** + * Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. + */ + geo?: Record | null | undefined; + /** + * Whether the short link's stats are publicly accessible. + */ + publicStats?: boolean | undefined; + /** + * [DEPRECATED] (use tagIds instead): The unique ID of the tag assigned to the short link. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + tagId?: string | null | undefined; + /** + * The unique IDs of the tags assigned to the short link. + */ + tagIds?: string | Array | undefined; + /** + * The comments for the short link. + */ + comments?: string | null | undefined; +}; + +export type BulkCreateLinksRequest = { + /** + * The ID of the workspace to create the link for. + */ + workspaceId: string; + requestBody?: Array | undefined; +}; + +/** @internal */ +export namespace BulkCreateLinksTagIds$ { + export type Inbound = string | Array; + + export type Outbound = string | Array; + export const inboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), + ]); + export const outboundSchema: z.ZodType = z.union( + [z.string(), z.array(z.string())] + ); +} + +/** @internal */ +export namespace RequestBody$ { + export type Inbound = { + domain?: string | undefined; + key?: string | undefined; + prefix?: string | undefined; + url: string; + archived?: boolean | undefined; + expiresAt?: string | null | undefined; + expiredUrl?: string | null | undefined; + password?: string | null | undefined; + proxy?: boolean | undefined; + title?: string | null | undefined; + description?: string | null | undefined; + image?: string | null | undefined; + rewrite?: boolean | undefined; + ios?: string | null | undefined; + android?: string | null | undefined; + geo?: Record | null | undefined; + publicStats?: boolean | undefined; + tagId?: string | null | undefined; + tagIds?: string | Array | undefined; + comments?: string | null | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + domain: z.string().optional(), + key: z.string().optional(), + prefix: z.string().optional(), + url: z.string(), + archived: z.boolean().default(false), + expiresAt: z.nullable(z.string()).optional(), + expiredUrl: z.nullable(z.string()).optional(), + password: z.nullable(z.string()).optional(), + proxy: z.boolean().default(false), + title: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + image: z.nullable(z.string()).optional(), + rewrite: z.boolean().default(false), + ios: z.nullable(z.string()).optional(), + android: z.nullable(z.string()).optional(), + geo: z.nullable(z.record(z.string())).optional(), + publicStats: z.boolean().default(false), + tagId: z.nullable(z.string()).optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + comments: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return { + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.prefix === undefined ? null : { prefix: v.prefix }), + url: v.url, + archived: v.archived, + ...(v.expiresAt === undefined ? null : { expiresAt: v.expiresAt }), + ...(v.expiredUrl === undefined ? null : { expiredUrl: v.expiredUrl }), + ...(v.password === undefined ? null : { password: v.password }), + proxy: v.proxy, + ...(v.title === undefined ? null : { title: v.title }), + ...(v.description === undefined ? null : { description: v.description }), + ...(v.image === undefined ? null : { image: v.image }), + rewrite: v.rewrite, + ...(v.ios === undefined ? null : { ios: v.ios }), + ...(v.android === undefined ? null : { android: v.android }), + ...(v.geo === undefined ? null : { geo: v.geo }), + publicStats: v.publicStats, + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.comments === undefined ? null : { comments: v.comments }), + }; + }); + + export type Outbound = { + domain?: string | undefined; + key?: string | undefined; + prefix?: string | undefined; + url: string; + archived: boolean; + expiresAt?: string | null | undefined; + expiredUrl?: string | null | undefined; + password?: string | null | undefined; + proxy: boolean; + title?: string | null | undefined; + description?: string | null | undefined; + image?: string | null | undefined; + rewrite: boolean; + ios?: string | null | undefined; + android?: string | null | undefined; + geo?: Record | null | undefined; + publicStats: boolean; + tagId?: string | null | undefined; + tagIds?: string | Array | undefined; + comments?: string | null | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + domain: z.string().optional(), + key: z.string().optional(), + prefix: z.string().optional(), + url: z.string(), + archived: z.boolean().default(false), + expiresAt: z.nullable(z.string()).optional(), + expiredUrl: z.nullable(z.string()).optional(), + password: z.nullable(z.string()).optional(), + proxy: z.boolean().default(false), + title: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + image: z.nullable(z.string()).optional(), + rewrite: z.boolean().default(false), + ios: z.nullable(z.string()).optional(), + android: z.nullable(z.string()).optional(), + geo: z.nullable(z.record(z.string())).optional(), + publicStats: z.boolean().default(false), + tagId: z.nullable(z.string()).optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + comments: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return { + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.prefix === undefined ? null : { prefix: v.prefix }), + url: v.url, + archived: v.archived, + ...(v.expiresAt === undefined ? null : { expiresAt: v.expiresAt }), + ...(v.expiredUrl === undefined ? null : { expiredUrl: v.expiredUrl }), + ...(v.password === undefined ? null : { password: v.password }), + proxy: v.proxy, + ...(v.title === undefined ? null : { title: v.title }), + ...(v.description === undefined ? null : { description: v.description }), + ...(v.image === undefined ? null : { image: v.image }), + rewrite: v.rewrite, + ...(v.ios === undefined ? null : { ios: v.ios }), + ...(v.android === undefined ? null : { android: v.android }), + ...(v.geo === undefined ? null : { geo: v.geo }), + publicStats: v.publicStats, + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.comments === undefined ? null : { comments: v.comments }), + }; + }); +} + +/** @internal */ +export namespace BulkCreateLinksRequest$ { + export type Inbound = { + workspaceId: string; + RequestBody?: Array | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + RequestBody: z.array(z.lazy(() => RequestBody$.inboundSchema)).optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.RequestBody === undefined ? null : { requestBody: v.RequestBody }), + }; + }); + + export type Outbound = { + workspaceId: string; + RequestBody?: Array | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + requestBody: z.array(z.lazy(() => RequestBody$.outboundSchema)).optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.requestBody === undefined ? null : { RequestBody: v.requestBody }), + }; + }); +} diff --git a/typescript/src/models/operations/createlink.ts b/typescript/src/models/operations/createlink.ts new file mode 100644 index 00000000..2275bbab --- /dev/null +++ b/typescript/src/models/operations/createlink.ts @@ -0,0 +1,300 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The unique IDs of the tags assigned to the short link. + */ +export type TagIds = string | Array; + +export type CreateLinkRequestBody = { + /** + * The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). + */ + domain?: string | undefined; + /** + * The short link slug. If not provided, a random 7-character slug will be generated. + */ + key?: string | undefined; + /** + * The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. + */ + prefix?: string | undefined; + /** + * The destination URL of the short link. + */ + url: string; + /** + * Whether the short link is archived. + */ + archived?: boolean | undefined; + /** + * The date and time when the short link will expire at. + */ + expiresAt?: string | null | undefined; + /** + * The URL to redirect to when the short link has expired. + */ + expiredUrl?: string | null | undefined; + /** + * The password required to access the destination URL of the short link. + */ + password?: string | null | undefined; + /** + * Whether the short link uses Custom Social Media Cards feature. + */ + proxy?: boolean | undefined; + /** + * The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + title?: string | null | undefined; + /** + * The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + description?: string | null | undefined; + /** + * The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + image?: string | null | undefined; + /** + * Whether the short link uses link cloaking. + */ + rewrite?: boolean | undefined; + /** + * The iOS destination URL for the short link for iOS device targeting. + */ + ios?: string | null | undefined; + /** + * The Android destination URL for the short link for Android device targeting. + */ + android?: string | null | undefined; + /** + * Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. + */ + geo?: Record | null | undefined; + /** + * Whether the short link's stats are publicly accessible. + */ + publicStats?: boolean | undefined; + /** + * [DEPRECATED] (use tagIds instead): The unique ID of the tag assigned to the short link. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + tagId?: string | null | undefined; + /** + * The unique IDs of the tags assigned to the short link. + */ + tagIds?: string | Array | undefined; + /** + * The comments for the short link. + */ + comments?: string | null | undefined; +}; + +export type CreateLinkRequest = { + /** + * The ID of the workspace to create the link for. + */ + workspaceId: string; + requestBody?: CreateLinkRequestBody | undefined; +}; + +/** @internal */ +export namespace TagIds$ { + export type Inbound = string | Array; + + export type Outbound = string | Array; + export const inboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), + ]); + export const outboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), + ]); +} + +/** @internal */ +export namespace CreateLinkRequestBody$ { + export type Inbound = { + domain?: string | undefined; + key?: string | undefined; + prefix?: string | undefined; + url: string; + archived?: boolean | undefined; + expiresAt?: string | null | undefined; + expiredUrl?: string | null | undefined; + password?: string | null | undefined; + proxy?: boolean | undefined; + title?: string | null | undefined; + description?: string | null | undefined; + image?: string | null | undefined; + rewrite?: boolean | undefined; + ios?: string | null | undefined; + android?: string | null | undefined; + geo?: Record | null | undefined; + publicStats?: boolean | undefined; + tagId?: string | null | undefined; + tagIds?: string | Array | undefined; + comments?: string | null | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + domain: z.string().optional(), + key: z.string().optional(), + prefix: z.string().optional(), + url: z.string(), + archived: z.boolean().default(false), + expiresAt: z.nullable(z.string()).optional(), + expiredUrl: z.nullable(z.string()).optional(), + password: z.nullable(z.string()).optional(), + proxy: z.boolean().default(false), + title: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + image: z.nullable(z.string()).optional(), + rewrite: z.boolean().default(false), + ios: z.nullable(z.string()).optional(), + android: z.nullable(z.string()).optional(), + geo: z.nullable(z.record(z.string())).optional(), + publicStats: z.boolean().default(false), + tagId: z.nullable(z.string()).optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + comments: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return { + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.prefix === undefined ? null : { prefix: v.prefix }), + url: v.url, + archived: v.archived, + ...(v.expiresAt === undefined ? null : { expiresAt: v.expiresAt }), + ...(v.expiredUrl === undefined ? null : { expiredUrl: v.expiredUrl }), + ...(v.password === undefined ? null : { password: v.password }), + proxy: v.proxy, + ...(v.title === undefined ? null : { title: v.title }), + ...(v.description === undefined ? null : { description: v.description }), + ...(v.image === undefined ? null : { image: v.image }), + rewrite: v.rewrite, + ...(v.ios === undefined ? null : { ios: v.ios }), + ...(v.android === undefined ? null : { android: v.android }), + ...(v.geo === undefined ? null : { geo: v.geo }), + publicStats: v.publicStats, + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.comments === undefined ? null : { comments: v.comments }), + }; + }); + + export type Outbound = { + domain?: string | undefined; + key?: string | undefined; + prefix?: string | undefined; + url: string; + archived: boolean; + expiresAt?: string | null | undefined; + expiredUrl?: string | null | undefined; + password?: string | null | undefined; + proxy: boolean; + title?: string | null | undefined; + description?: string | null | undefined; + image?: string | null | undefined; + rewrite: boolean; + ios?: string | null | undefined; + android?: string | null | undefined; + geo?: Record | null | undefined; + publicStats: boolean; + tagId?: string | null | undefined; + tagIds?: string | Array | undefined; + comments?: string | null | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + domain: z.string().optional(), + key: z.string().optional(), + prefix: z.string().optional(), + url: z.string(), + archived: z.boolean().default(false), + expiresAt: z.nullable(z.string()).optional(), + expiredUrl: z.nullable(z.string()).optional(), + password: z.nullable(z.string()).optional(), + proxy: z.boolean().default(false), + title: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + image: z.nullable(z.string()).optional(), + rewrite: z.boolean().default(false), + ios: z.nullable(z.string()).optional(), + android: z.nullable(z.string()).optional(), + geo: z.nullable(z.record(z.string())).optional(), + publicStats: z.boolean().default(false), + tagId: z.nullable(z.string()).optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + comments: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return { + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.prefix === undefined ? null : { prefix: v.prefix }), + url: v.url, + archived: v.archived, + ...(v.expiresAt === undefined ? null : { expiresAt: v.expiresAt }), + ...(v.expiredUrl === undefined ? null : { expiredUrl: v.expiredUrl }), + ...(v.password === undefined ? null : { password: v.password }), + proxy: v.proxy, + ...(v.title === undefined ? null : { title: v.title }), + ...(v.description === undefined ? null : { description: v.description }), + ...(v.image === undefined ? null : { image: v.image }), + rewrite: v.rewrite, + ...(v.ios === undefined ? null : { ios: v.ios }), + ...(v.android === undefined ? null : { android: v.android }), + ...(v.geo === undefined ? null : { geo: v.geo }), + publicStats: v.publicStats, + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.comments === undefined ? null : { comments: v.comments }), + }; + }); +} + +/** @internal */ +export namespace CreateLinkRequest$ { + export type Inbound = { + workspaceId: string; + RequestBody?: CreateLinkRequestBody$.Inbound | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + RequestBody: z.lazy(() => CreateLinkRequestBody$.inboundSchema).optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.RequestBody === undefined ? null : { requestBody: v.RequestBody }), + }; + }); + + export type Outbound = { + workspaceId: string; + RequestBody?: CreateLinkRequestBody$.Outbound | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + requestBody: z.lazy(() => CreateLinkRequestBody$.outboundSchema).optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.requestBody === undefined ? null : { RequestBody: v.requestBody }), + }; + }); +} diff --git a/typescript/src/models/operations/createtag.ts b/typescript/src/models/operations/createtag.ts new file mode 100644 index 00000000..fde9ab03 --- /dev/null +++ b/typescript/src/models/operations/createtag.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, pink, brown. + */ +export enum Color { + Red = "red", + Yellow = "yellow", + Green = "green", + Blue = "blue", + Purple = "purple", + Pink = "pink", + Brown = "brown", +} + +export type CreateTagRequestBody = { + /** + * The name of the tag to create. + */ + tag: string; + /** + * The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, pink, brown. + */ + color?: Color | undefined; +}; + +export type CreateTagRequest = { + /** + * The ID of the workspace to create the tag for. + */ + workspaceId: string; + requestBody?: CreateTagRequestBody | undefined; +}; + +/** @internal */ +export const Color$ = z.nativeEnum(Color); + +/** @internal */ +export namespace CreateTagRequestBody$ { + export type Inbound = { + tag: string; + color?: Color | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + tag: z.string(), + color: Color$.optional(), + }) + .transform((v) => { + return { + tag: v.tag, + ...(v.color === undefined ? null : { color: v.color }), + }; + }); + + export type Outbound = { + tag: string; + color?: Color | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + tag: z.string(), + color: Color$.optional(), + }) + .transform((v) => { + return { + tag: v.tag, + ...(v.color === undefined ? null : { color: v.color }), + }; + }); +} + +/** @internal */ +export namespace CreateTagRequest$ { + export type Inbound = { + workspaceId: string; + RequestBody?: CreateTagRequestBody$.Inbound | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + RequestBody: z.lazy(() => CreateTagRequestBody$.inboundSchema).optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.RequestBody === undefined ? null : { requestBody: v.RequestBody }), + }; + }); + + export type Outbound = { + workspaceId: string; + RequestBody?: CreateTagRequestBody$.Outbound | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + requestBody: z.lazy(() => CreateTagRequestBody$.outboundSchema).optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.requestBody === undefined ? null : { RequestBody: v.requestBody }), + }; + }); +} diff --git a/typescript/src/models/operations/createworkspace.ts b/typescript/src/models/operations/createworkspace.ts new file mode 100644 index 00000000..078c0909 --- /dev/null +++ b/typescript/src/models/operations/createworkspace.ts @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type CreateWorkspaceRequestBody = { + name: string; + slug: string; + domain?: string | undefined; +}; + +/** @internal */ +export namespace CreateWorkspaceRequestBody$ { + export type Inbound = { + name: string; + slug: string; + domain?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + name: z.string(), + slug: z.string(), + domain: z.string().optional(), + }) + .transform((v) => { + return { + name: v.name, + slug: v.slug, + ...(v.domain === undefined ? null : { domain: v.domain }), + }; + }); + + export type Outbound = { + name: string; + slug: string; + domain?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + name: z.string(), + slug: z.string(), + domain: z.string().optional(), + }) + .transform((v) => { + return { + name: v.name, + slug: v.slug, + ...(v.domain === undefined ? null : { domain: v.domain }), + }; + }); +} diff --git a/typescript/src/models/operations/deletelink.ts b/typescript/src/models/operations/deletelink.ts new file mode 100644 index 00000000..75057eec --- /dev/null +++ b/typescript/src/models/operations/deletelink.ts @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type DeleteLinkRequest = { + /** + * The id of the link to delete. You can get this via the `getLinkInfo` endpoint. + */ + linkId: string; + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; +}; + +/** @internal */ +export namespace DeleteLinkRequest$ { + export type Inbound = { + linkId: string; + workspaceId: string; + }; + + export const inboundSchema: z.ZodType = z + .object({ + linkId: z.string(), + workspaceId: z.string(), + }) + .transform((v) => { + return { + linkId: v.linkId, + workspaceId: v.workspaceId, + }; + }); + + export type Outbound = { + linkId: string; + workspaceId: string; + }; + + export const outboundSchema: z.ZodType = z + .object({ + linkId: z.string(), + workspaceId: z.string(), + }) + .transform((v) => { + return { + linkId: v.linkId, + workspaceId: v.workspaceId, + }; + }); +} diff --git a/typescript/src/models/operations/editlink.ts b/typescript/src/models/operations/editlink.ts new file mode 100644 index 00000000..fb21bdfb --- /dev/null +++ b/typescript/src/models/operations/editlink.ts @@ -0,0 +1,310 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The unique IDs of the tags assigned to the short link. + */ +export type EditLinkTagIds = string | Array; + +export type EditLinkRequestBody = { + /** + * The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). + */ + domain?: string | undefined; + /** + * The short link slug. If not provided, a random 7-character slug will be generated. + */ + key?: string | undefined; + /** + * The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. + */ + prefix?: string | undefined; + /** + * The destination URL of the short link. + */ + url: string; + /** + * Whether the short link is archived. + */ + archived?: boolean | undefined; + /** + * The date and time when the short link will expire at. + */ + expiresAt?: string | null | undefined; + /** + * The URL to redirect to when the short link has expired. + */ + expiredUrl?: string | null | undefined; + /** + * The password required to access the destination URL of the short link. + */ + password?: string | null | undefined; + /** + * Whether the short link uses Custom Social Media Cards feature. + */ + proxy?: boolean | undefined; + /** + * The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + title?: string | null | undefined; + /** + * The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + description?: string | null | undefined; + /** + * The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + */ + image?: string | null | undefined; + /** + * Whether the short link uses link cloaking. + */ + rewrite?: boolean | undefined; + /** + * The iOS destination URL for the short link for iOS device targeting. + */ + ios?: string | null | undefined; + /** + * The Android destination URL for the short link for Android device targeting. + */ + android?: string | null | undefined; + /** + * Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. + */ + geo?: Record | null | undefined; + /** + * Whether the short link's stats are publicly accessible. + */ + publicStats?: boolean | undefined; + /** + * [DEPRECATED] (use tagIds instead): The unique ID of the tag assigned to the short link. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + tagId?: string | null | undefined; + /** + * The unique IDs of the tags assigned to the short link. + */ + tagIds?: string | Array | undefined; + /** + * The comments for the short link. + */ + comments?: string | null | undefined; +}; + +export type EditLinkRequest = { + /** + * The id of the link to edit. You can get this via the `getLinkInfo` endpoint. + */ + linkId: string; + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + requestBody?: EditLinkRequestBody | undefined; +}; + +/** @internal */ +export namespace EditLinkTagIds$ { + export type Inbound = string | Array; + + export type Outbound = string | Array; + export const inboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), + ]); + export const outboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), + ]); +} + +/** @internal */ +export namespace EditLinkRequestBody$ { + export type Inbound = { + domain?: string | undefined; + key?: string | undefined; + prefix?: string | undefined; + url: string; + archived?: boolean | undefined; + expiresAt?: string | null | undefined; + expiredUrl?: string | null | undefined; + password?: string | null | undefined; + proxy?: boolean | undefined; + title?: string | null | undefined; + description?: string | null | undefined; + image?: string | null | undefined; + rewrite?: boolean | undefined; + ios?: string | null | undefined; + android?: string | null | undefined; + geo?: Record | null | undefined; + publicStats?: boolean | undefined; + tagId?: string | null | undefined; + tagIds?: string | Array | undefined; + comments?: string | null | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + domain: z.string().optional(), + key: z.string().optional(), + prefix: z.string().optional(), + url: z.string(), + archived: z.boolean().default(false), + expiresAt: z.nullable(z.string()).optional(), + expiredUrl: z.nullable(z.string()).optional(), + password: z.nullable(z.string()).optional(), + proxy: z.boolean().default(false), + title: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + image: z.nullable(z.string()).optional(), + rewrite: z.boolean().default(false), + ios: z.nullable(z.string()).optional(), + android: z.nullable(z.string()).optional(), + geo: z.nullable(z.record(z.string())).optional(), + publicStats: z.boolean().default(false), + tagId: z.nullable(z.string()).optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + comments: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return { + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.prefix === undefined ? null : { prefix: v.prefix }), + url: v.url, + archived: v.archived, + ...(v.expiresAt === undefined ? null : { expiresAt: v.expiresAt }), + ...(v.expiredUrl === undefined ? null : { expiredUrl: v.expiredUrl }), + ...(v.password === undefined ? null : { password: v.password }), + proxy: v.proxy, + ...(v.title === undefined ? null : { title: v.title }), + ...(v.description === undefined ? null : { description: v.description }), + ...(v.image === undefined ? null : { image: v.image }), + rewrite: v.rewrite, + ...(v.ios === undefined ? null : { ios: v.ios }), + ...(v.android === undefined ? null : { android: v.android }), + ...(v.geo === undefined ? null : { geo: v.geo }), + publicStats: v.publicStats, + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.comments === undefined ? null : { comments: v.comments }), + }; + }); + + export type Outbound = { + domain?: string | undefined; + key?: string | undefined; + prefix?: string | undefined; + url: string; + archived: boolean; + expiresAt?: string | null | undefined; + expiredUrl?: string | null | undefined; + password?: string | null | undefined; + proxy: boolean; + title?: string | null | undefined; + description?: string | null | undefined; + image?: string | null | undefined; + rewrite: boolean; + ios?: string | null | undefined; + android?: string | null | undefined; + geo?: Record | null | undefined; + publicStats: boolean; + tagId?: string | null | undefined; + tagIds?: string | Array | undefined; + comments?: string | null | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + domain: z.string().optional(), + key: z.string().optional(), + prefix: z.string().optional(), + url: z.string(), + archived: z.boolean().default(false), + expiresAt: z.nullable(z.string()).optional(), + expiredUrl: z.nullable(z.string()).optional(), + password: z.nullable(z.string()).optional(), + proxy: z.boolean().default(false), + title: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + image: z.nullable(z.string()).optional(), + rewrite: z.boolean().default(false), + ios: z.nullable(z.string()).optional(), + android: z.nullable(z.string()).optional(), + geo: z.nullable(z.record(z.string())).optional(), + publicStats: z.boolean().default(false), + tagId: z.nullable(z.string()).optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + comments: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return { + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.prefix === undefined ? null : { prefix: v.prefix }), + url: v.url, + archived: v.archived, + ...(v.expiresAt === undefined ? null : { expiresAt: v.expiresAt }), + ...(v.expiredUrl === undefined ? null : { expiredUrl: v.expiredUrl }), + ...(v.password === undefined ? null : { password: v.password }), + proxy: v.proxy, + ...(v.title === undefined ? null : { title: v.title }), + ...(v.description === undefined ? null : { description: v.description }), + ...(v.image === undefined ? null : { image: v.image }), + rewrite: v.rewrite, + ...(v.ios === undefined ? null : { ios: v.ios }), + ...(v.android === undefined ? null : { android: v.android }), + ...(v.geo === undefined ? null : { geo: v.geo }), + publicStats: v.publicStats, + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.comments === undefined ? null : { comments: v.comments }), + }; + }); +} + +/** @internal */ +export namespace EditLinkRequest$ { + export type Inbound = { + linkId: string; + workspaceId: string; + RequestBody?: EditLinkRequestBody$.Inbound | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + linkId: z.string(), + workspaceId: z.string(), + RequestBody: z.lazy(() => EditLinkRequestBody$.inboundSchema).optional(), + }) + .transform((v) => { + return { + linkId: v.linkId, + workspaceId: v.workspaceId, + ...(v.RequestBody === undefined ? null : { requestBody: v.RequestBody }), + }; + }); + + export type Outbound = { + linkId: string; + workspaceId: string; + RequestBody?: EditLinkRequestBody$.Outbound | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + linkId: z.string(), + workspaceId: z.string(), + requestBody: z.lazy(() => EditLinkRequestBody$.outboundSchema).optional(), + }) + .transform((v) => { + return { + linkId: v.linkId, + workspaceId: v.workspaceId, + ...(v.requestBody === undefined ? null : { RequestBody: v.requestBody }), + }; + }); +} diff --git a/typescript/src/models/operations/getbrowseranalytics.ts b/typescript/src/models/operations/getbrowseranalytics.ts new file mode 100644 index 00000000..546fc465 --- /dev/null +++ b/typescript/src/models/operations/getbrowseranalytics.ts @@ -0,0 +1,494 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The interval to retrieve analytics for. + */ +export enum GetBrowserAnalyticsQueryParamInterval { + Oneh = "1h", + TwentyFourh = "24h", + Sevend = "7d", + Thirtyd = "30d", + Ninetyd = "90d", + All = "all", +} + +/** + * The country to retrieve analytics for. + */ +export enum GetBrowserAnalyticsQueryParamCountry { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetBrowserAnalyticsRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain of the short link. + */ + domain?: string | undefined; + /** + * The short link slug. + */ + key?: string | undefined; + /** + * The interval to retrieve analytics for. + */ + interval?: GetBrowserAnalyticsQueryParamInterval | undefined; + /** + * The country to retrieve analytics for. + */ + country?: GetBrowserAnalyticsQueryParamCountry | undefined; + /** + * The city to retrieve analytics for. + */ + city?: string | undefined; + /** + * The device to retrieve analytics for. + */ + device?: string | undefined; + /** + * The browser to retrieve analytics for. + */ + browser?: string | undefined; + /** + * The OS to retrieve analytics for. + */ + os?: string | undefined; + /** + * The referer to retrieve analytics for. + */ + referer?: string | undefined; + /** + * The URL to retrieve analytics for. + */ + url?: string | undefined; + /** + * Whether to exclude the root link from the response. + */ + excludeRoot?: boolean | undefined; + /** + * The tag ID to retrieve analytics for. + */ + tagId?: string | undefined; +}; + +export type GetBrowserAnalyticsResponseBody = { + /** + * The name of the browser + */ + browser: string; + /** + * The number of clicks from this browser + */ + clicks: number; +}; + +/** @internal */ +export const GetBrowserAnalyticsQueryParamInterval$ = z.nativeEnum( + GetBrowserAnalyticsQueryParamInterval +); + +/** @internal */ +export const GetBrowserAnalyticsQueryParamCountry$ = z.nativeEnum( + GetBrowserAnalyticsQueryParamCountry +); + +/** @internal */ +export namespace GetBrowserAnalyticsRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetBrowserAnalyticsQueryParamInterval | undefined; + country?: GetBrowserAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetBrowserAnalyticsQueryParamInterval$.optional(), + country: GetBrowserAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetBrowserAnalyticsQueryParamInterval | undefined; + country?: GetBrowserAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetBrowserAnalyticsQueryParamInterval$.optional(), + country: GetBrowserAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); +} + +/** @internal */ +export namespace GetBrowserAnalyticsResponseBody$ { + export type Inbound = { + browser: string; + clicks: number; + }; + + export const inboundSchema: z.ZodType = + z + .object({ + browser: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + browser: v.browser, + clicks: v.clicks, + }; + }); + + export type Outbound = { + browser: string; + clicks: number; + }; + + export const outboundSchema: z.ZodType< + Outbound, + z.ZodTypeDef, + GetBrowserAnalyticsResponseBody + > = z + .object({ + browser: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + browser: v.browser, + clicks: v.clicks, + }; + }); +} diff --git a/typescript/src/models/operations/getcityanalytics.ts b/typescript/src/models/operations/getcityanalytics.ts new file mode 100644 index 00000000..26c6c892 --- /dev/null +++ b/typescript/src/models/operations/getcityanalytics.ts @@ -0,0 +1,754 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The interval to retrieve analytics for. + */ +export enum GetCityAnalyticsQueryParamInterval { + Oneh = "1h", + TwentyFourh = "24h", + Sevend = "7d", + Thirtyd = "30d", + Ninetyd = "90d", + All = "all", +} + +/** + * The country to retrieve analytics for. + */ +export enum GetCityAnalyticsQueryParamCountry { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetCityAnalyticsRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain of the short link. + */ + domain?: string | undefined; + /** + * The short link slug. + */ + key?: string | undefined; + /** + * The interval to retrieve analytics for. + */ + interval?: GetCityAnalyticsQueryParamInterval | undefined; + /** + * The country to retrieve analytics for. + */ + country?: GetCityAnalyticsQueryParamCountry | undefined; + /** + * The city to retrieve analytics for. + */ + city?: string | undefined; + /** + * The device to retrieve analytics for. + */ + device?: string | undefined; + /** + * The browser to retrieve analytics for. + */ + browser?: string | undefined; + /** + * The OS to retrieve analytics for. + */ + os?: string | undefined; + /** + * The referer to retrieve analytics for. + */ + referer?: string | undefined; + /** + * The URL to retrieve analytics for. + */ + url?: string | undefined; + /** + * Whether to exclude the root link from the response. + */ + excludeRoot?: boolean | undefined; + /** + * The tag ID to retrieve analytics for. + */ + tagId?: string | undefined; +}; + +/** + * The 2-letter country code of the city: https://d.to/geo + */ +export enum GetCityAnalyticsCountry { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetCityAnalyticsResponseBody = { + /** + * The name of the city + */ + city: string; + /** + * The 2-letter country code of the city: https://d.to/geo + */ + country: GetCityAnalyticsCountry; + /** + * The number of clicks from this city + */ + clicks: number; +}; + +/** @internal */ +export const GetCityAnalyticsQueryParamInterval$ = z.nativeEnum(GetCityAnalyticsQueryParamInterval); + +/** @internal */ +export const GetCityAnalyticsQueryParamCountry$ = z.nativeEnum(GetCityAnalyticsQueryParamCountry); + +/** @internal */ +export namespace GetCityAnalyticsRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetCityAnalyticsQueryParamInterval | undefined; + country?: GetCityAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetCityAnalyticsQueryParamInterval$.optional(), + country: GetCityAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetCityAnalyticsQueryParamInterval | undefined; + country?: GetCityAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetCityAnalyticsQueryParamInterval$.optional(), + country: GetCityAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); +} + +/** @internal */ +export const GetCityAnalyticsCountry$ = z.nativeEnum(GetCityAnalyticsCountry); + +/** @internal */ +export namespace GetCityAnalyticsResponseBody$ { + export type Inbound = { + city: string; + country: GetCityAnalyticsCountry; + clicks: number; + }; + + export const inboundSchema: z.ZodType = z + .object({ + city: z.string(), + country: GetCityAnalyticsCountry$, + clicks: z.number(), + }) + .transform((v) => { + return { + city: v.city, + country: v.country, + clicks: v.clicks, + }; + }); + + export type Outbound = { + city: string; + country: GetCityAnalyticsCountry; + clicks: number; + }; + + export const outboundSchema: z.ZodType = z + .object({ + city: z.string(), + country: GetCityAnalyticsCountry$, + clicks: z.number(), + }) + .transform((v) => { + return { + city: v.city, + country: v.country, + clicks: v.clicks, + }; + }); +} diff --git a/typescript/src/models/operations/getclicksanalytics.ts b/typescript/src/models/operations/getclicksanalytics.ts new file mode 100644 index 00000000..aa230009 --- /dev/null +++ b/typescript/src/models/operations/getclicksanalytics.ts @@ -0,0 +1,437 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The interval to retrieve analytics for. + */ +export enum Interval { + Oneh = "1h", + TwentyFourh = "24h", + Sevend = "7d", + Thirtyd = "30d", + Ninetyd = "90d", + All = "all", +} + +/** + * The country to retrieve analytics for. + */ +export enum Country { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetClicksAnalyticsRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain of the short link. + */ + domain?: string | undefined; + /** + * The short link slug. + */ + key?: string | undefined; + /** + * The interval to retrieve analytics for. + */ + interval?: Interval | undefined; + /** + * The country to retrieve analytics for. + */ + country?: Country | undefined; + /** + * The city to retrieve analytics for. + */ + city?: string | undefined; + /** + * The device to retrieve analytics for. + */ + device?: string | undefined; + /** + * The browser to retrieve analytics for. + */ + browser?: string | undefined; + /** + * The OS to retrieve analytics for. + */ + os?: string | undefined; + /** + * The referer to retrieve analytics for. + */ + referer?: string | undefined; + /** + * The URL to retrieve analytics for. + */ + url?: string | undefined; + /** + * Whether to exclude the root link from the response. + */ + excludeRoot?: boolean | undefined; + /** + * The tag ID to retrieve analytics for. + */ + tagId?: string | undefined; +}; + +/** @internal */ +export const Interval$ = z.nativeEnum(Interval); + +/** @internal */ +export const Country$ = z.nativeEnum(Country); + +/** @internal */ +export namespace GetClicksAnalyticsRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: Interval | undefined; + country?: Country | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: Interval$.optional(), + country: Country$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: Interval | undefined; + country?: Country | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: Interval$.optional(), + country: Country$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); +} diff --git a/typescript/src/models/operations/getcountryanalytics.ts b/typescript/src/models/operations/getcountryanalytics.ts new file mode 100644 index 00000000..7b4b784d --- /dev/null +++ b/typescript/src/models/operations/getcountryanalytics.ts @@ -0,0 +1,753 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The interval to retrieve analytics for. + */ +export enum GetCountryAnalyticsQueryParamInterval { + Oneh = "1h", + TwentyFourh = "24h", + Sevend = "7d", + Thirtyd = "30d", + Ninetyd = "90d", + All = "all", +} + +/** + * The country to retrieve analytics for. + */ +export enum GetCountryAnalyticsQueryParamCountry { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetCountryAnalyticsRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain of the short link. + */ + domain?: string | undefined; + /** + * The short link slug. + */ + key?: string | undefined; + /** + * The interval to retrieve analytics for. + */ + interval?: GetCountryAnalyticsQueryParamInterval | undefined; + /** + * The country to retrieve analytics for. + */ + country?: GetCountryAnalyticsQueryParamCountry | undefined; + /** + * The city to retrieve analytics for. + */ + city?: string | undefined; + /** + * The device to retrieve analytics for. + */ + device?: string | undefined; + /** + * The browser to retrieve analytics for. + */ + browser?: string | undefined; + /** + * The OS to retrieve analytics for. + */ + os?: string | undefined; + /** + * The referer to retrieve analytics for. + */ + referer?: string | undefined; + /** + * The URL to retrieve analytics for. + */ + url?: string | undefined; + /** + * Whether to exclude the root link from the response. + */ + excludeRoot?: boolean | undefined; + /** + * The tag ID to retrieve analytics for. + */ + tagId?: string | undefined; +}; + +/** + * The 2-letter country code: https://d.to/geo + */ +export enum GetCountryAnalyticsCountry { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetCountryAnalyticsResponseBody = { + /** + * The 2-letter country code: https://d.to/geo + */ + country: GetCountryAnalyticsCountry; + /** + * The number of clicks from this country + */ + clicks: number; +}; + +/** @internal */ +export const GetCountryAnalyticsQueryParamInterval$ = z.nativeEnum( + GetCountryAnalyticsQueryParamInterval +); + +/** @internal */ +export const GetCountryAnalyticsQueryParamCountry$ = z.nativeEnum( + GetCountryAnalyticsQueryParamCountry +); + +/** @internal */ +export namespace GetCountryAnalyticsRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetCountryAnalyticsQueryParamInterval | undefined; + country?: GetCountryAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetCountryAnalyticsQueryParamInterval$.optional(), + country: GetCountryAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetCountryAnalyticsQueryParamInterval | undefined; + country?: GetCountryAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetCountryAnalyticsQueryParamInterval$.optional(), + country: GetCountryAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); +} + +/** @internal */ +export const GetCountryAnalyticsCountry$ = z.nativeEnum(GetCountryAnalyticsCountry); + +/** @internal */ +export namespace GetCountryAnalyticsResponseBody$ { + export type Inbound = { + country: GetCountryAnalyticsCountry; + clicks: number; + }; + + export const inboundSchema: z.ZodType = + z + .object({ + country: GetCountryAnalyticsCountry$, + clicks: z.number(), + }) + .transform((v) => { + return { + country: v.country, + clicks: v.clicks, + }; + }); + + export type Outbound = { + country: GetCountryAnalyticsCountry; + clicks: number; + }; + + export const outboundSchema: z.ZodType< + Outbound, + z.ZodTypeDef, + GetCountryAnalyticsResponseBody + > = z + .object({ + country: GetCountryAnalyticsCountry$, + clicks: z.number(), + }) + .transform((v) => { + return { + country: v.country, + clicks: v.clicks, + }; + }); +} diff --git a/typescript/src/models/operations/getdeviceanalytics.ts b/typescript/src/models/operations/getdeviceanalytics.ts new file mode 100644 index 00000000..08d0edf4 --- /dev/null +++ b/typescript/src/models/operations/getdeviceanalytics.ts @@ -0,0 +1,490 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The interval to retrieve analytics for. + */ +export enum GetDeviceAnalyticsQueryParamInterval { + Oneh = "1h", + TwentyFourh = "24h", + Sevend = "7d", + Thirtyd = "30d", + Ninetyd = "90d", + All = "all", +} + +/** + * The country to retrieve analytics for. + */ +export enum GetDeviceAnalyticsQueryParamCountry { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetDeviceAnalyticsRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain of the short link. + */ + domain?: string | undefined; + /** + * The short link slug. + */ + key?: string | undefined; + /** + * The interval to retrieve analytics for. + */ + interval?: GetDeviceAnalyticsQueryParamInterval | undefined; + /** + * The country to retrieve analytics for. + */ + country?: GetDeviceAnalyticsQueryParamCountry | undefined; + /** + * The city to retrieve analytics for. + */ + city?: string | undefined; + /** + * The device to retrieve analytics for. + */ + device?: string | undefined; + /** + * The browser to retrieve analytics for. + */ + browser?: string | undefined; + /** + * The OS to retrieve analytics for. + */ + os?: string | undefined; + /** + * The referer to retrieve analytics for. + */ + referer?: string | undefined; + /** + * The URL to retrieve analytics for. + */ + url?: string | undefined; + /** + * Whether to exclude the root link from the response. + */ + excludeRoot?: boolean | undefined; + /** + * The tag ID to retrieve analytics for. + */ + tagId?: string | undefined; +}; + +export type GetDeviceAnalyticsResponseBody = { + /** + * The name of the device + */ + device: string; + /** + * The number of clicks from this device + */ + clicks: number; +}; + +/** @internal */ +export const GetDeviceAnalyticsQueryParamInterval$ = z.nativeEnum( + GetDeviceAnalyticsQueryParamInterval +); + +/** @internal */ +export const GetDeviceAnalyticsQueryParamCountry$ = z.nativeEnum( + GetDeviceAnalyticsQueryParamCountry +); + +/** @internal */ +export namespace GetDeviceAnalyticsRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetDeviceAnalyticsQueryParamInterval | undefined; + country?: GetDeviceAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetDeviceAnalyticsQueryParamInterval$.optional(), + country: GetDeviceAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetDeviceAnalyticsQueryParamInterval | undefined; + country?: GetDeviceAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetDeviceAnalyticsQueryParamInterval$.optional(), + country: GetDeviceAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); +} + +/** @internal */ +export namespace GetDeviceAnalyticsResponseBody$ { + export type Inbound = { + device: string; + clicks: number; + }; + + export const inboundSchema: z.ZodType = z + .object({ + device: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + device: v.device, + clicks: v.clicks, + }; + }); + + export type Outbound = { + device: string; + clicks: number; + }; + + export const outboundSchema: z.ZodType = + z + .object({ + device: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + device: v.device, + clicks: v.clicks, + }; + }); +} diff --git a/typescript/src/models/operations/getlinkinfo.ts b/typescript/src/models/operations/getlinkinfo.ts new file mode 100644 index 00000000..82db03be --- /dev/null +++ b/typescript/src/models/operations/getlinkinfo.ts @@ -0,0 +1,63 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type GetLinkInfoRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain of the link to retrieve. E.g. for `d.to/github`, the domain is `d.to`. + */ + domain: string; + /** + * The key of the link to retrieve. E.g. for `d.to/github`, the key is `github`. + */ + key: string; +}; + +/** @internal */ +export namespace GetLinkInfoRequest$ { + export type Inbound = { + workspaceId: string; + domain: string; + key: string; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string(), + key: z.string(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + domain: v.domain, + key: v.key, + }; + }); + + export type Outbound = { + workspaceId: string; + domain: string; + key: string; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string(), + key: z.string(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + domain: v.domain, + key: v.key, + }; + }); +} diff --git a/typescript/src/models/operations/getlinks.ts b/typescript/src/models/operations/getlinks.ts new file mode 100644 index 00000000..c6328c42 --- /dev/null +++ b/typescript/src/models/operations/getlinks.ts @@ -0,0 +1,165 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The tag IDs to filter the links by. + */ +export type QueryParamTagIds = string | Array; + +/** + * The field to sort the links by. The default is `createdAt`, and sort order is always descending. + */ +export enum Sort { + CreatedAt = "createdAt", + Clicks = "clicks", + LastClicked = "lastClicked", +} + +export type GetLinksRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned. + */ + domain?: string | undefined; + /** + * [DEPRECATED] (use tagIds instead): The tag ID to filter the links by. + */ + tagId?: string | undefined; + /** + * The tag IDs to filter the links by. + */ + tagIds?: string | Array | undefined; + /** + * The search term to filter the links by. The search term will be matched against the short link slug and the destination url. + */ + search?: string | undefined; + /** + * The user ID to filter the links by. + */ + userId?: string | undefined; + /** + * Whether to include archived links in the response. Defaults to `false` if not provided. + */ + showArchived?: boolean | undefined; + /** + * Whether to include tags in the response. Defaults to `false` if not provided. + */ + withTags?: boolean | undefined; + /** + * The field to sort the links by. The default is `createdAt`, and sort order is always descending. + */ + sort?: Sort | undefined; + /** + * The page number for pagination (each page contains 100 links). + */ + page?: number | undefined; +}; + +/** @internal */ +export namespace QueryParamTagIds$ { + export type Inbound = string | Array; + + export type Outbound = string | Array; + export const inboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), + ]); + export const outboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), + ]); +} + +/** @internal */ +export const Sort$ = z.nativeEnum(Sort); + +/** @internal */ +export namespace GetLinksRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + tagId?: string | undefined; + tagIds?: string | Array | undefined; + search?: string | undefined; + userId?: string | undefined; + showArchived?: boolean | undefined; + withTags?: boolean | undefined; + sort?: Sort | undefined; + page?: number | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + tagId: z.string().optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + search: z.string().optional(), + userId: z.string().optional(), + showArchived: z.boolean().default(false), + withTags: z.boolean().default(false), + sort: Sort$.default(Sort.CreatedAt), + page: z.number().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.search === undefined ? null : { search: v.search }), + ...(v.userId === undefined ? null : { userId: v.userId }), + showArchived: v.showArchived, + withTags: v.withTags, + sort: v.sort, + ...(v.page === undefined ? null : { page: v.page }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + tagId?: string | undefined; + tagIds?: string | Array | undefined; + search?: string | undefined; + userId?: string | undefined; + showArchived: boolean; + withTags: boolean; + sort: Sort; + page?: number | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + tagId: z.string().optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + search: z.string().optional(), + userId: z.string().optional(), + showArchived: z.boolean().default(false), + withTags: z.boolean().default(false), + sort: Sort$.default(Sort.CreatedAt), + page: z.number().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.search === undefined ? null : { search: v.search }), + ...(v.userId === undefined ? null : { userId: v.userId }), + showArchived: v.showArchived, + withTags: v.withTags, + sort: v.sort, + ...(v.page === undefined ? null : { page: v.page }), + }; + }); +} diff --git a/typescript/src/models/operations/getlinkscount.ts b/typescript/src/models/operations/getlinkscount.ts new file mode 100644 index 00000000..d9ef8718 --- /dev/null +++ b/typescript/src/models/operations/getlinkscount.ts @@ -0,0 +1,167 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The tag IDs to filter the links by. + */ +export type GetLinksCountQueryParamTagIds = string | Array; + +export enum Two { + TagId = "tagId", +} + +export enum One { + Domain = "domain", +} + +/** + * The field to group the links by. + */ +export type GroupBy = One | Two; + +export type GetLinksCountRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned. + */ + domain?: string | undefined; + /** + * [DEPRECATED] (use tagIds instead): The tag ID to filter the links by. + */ + tagId?: string | undefined; + /** + * The tag IDs to filter the links by. + */ + tagIds?: string | Array | undefined; + /** + * The search term to filter the links by. The search term will be matched against the short link slug and the destination url. + */ + search?: string | undefined; + /** + * The user ID to filter the links by. + */ + userId?: string | undefined; + /** + * Whether to include archived links in the response. Defaults to `false` if not provided. + */ + showArchived?: boolean | undefined; + /** + * Whether to include tags in the response. Defaults to `false` if not provided. + */ + withTags?: boolean | undefined; + /** + * The field to group the links by. + */ + groupBy?: One | Two | undefined; +}; + +/** @internal */ +export namespace GetLinksCountQueryParamTagIds$ { + export type Inbound = string | Array; + + export type Outbound = string | Array; + export const inboundSchema: z.ZodType = + z.union([z.string(), z.array(z.string())]); + export const outboundSchema: z.ZodType = + z.union([z.string(), z.array(z.string())]); +} + +/** @internal */ +export const Two$ = z.nativeEnum(Two); + +/** @internal */ +export const One$ = z.nativeEnum(One); + +/** @internal */ +export namespace GroupBy$ { + export type Inbound = One | Two; + + export type Outbound = One | Two; + export const inboundSchema: z.ZodType = z.union([One$, Two$]); + export const outboundSchema: z.ZodType = z.union([One$, Two$]); +} + +/** @internal */ +export namespace GetLinksCountRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + tagId?: string | undefined; + tagIds?: string | Array | undefined; + search?: string | undefined; + userId?: string | undefined; + showArchived?: boolean | undefined; + withTags?: boolean | undefined; + groupBy?: One | Two | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + tagId: z.string().optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + search: z.string().optional(), + userId: z.string().optional(), + showArchived: z.boolean().default(false), + withTags: z.boolean().default(false), + groupBy: z.union([One$, Two$]).optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.search === undefined ? null : { search: v.search }), + ...(v.userId === undefined ? null : { userId: v.userId }), + showArchived: v.showArchived, + withTags: v.withTags, + ...(v.groupBy === undefined ? null : { groupBy: v.groupBy }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + tagId?: string | undefined; + tagIds?: string | Array | undefined; + search?: string | undefined; + userId?: string | undefined; + showArchived: boolean; + withTags: boolean; + groupBy?: One | Two | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + tagId: z.string().optional(), + tagIds: z.union([z.string(), z.array(z.string())]).optional(), + search: z.string().optional(), + userId: z.string().optional(), + showArchived: z.boolean().default(false), + withTags: z.boolean().default(false), + groupBy: z.union([One$, Two$]).optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + ...(v.tagIds === undefined ? null : { tagIds: v.tagIds }), + ...(v.search === undefined ? null : { search: v.search }), + ...(v.userId === undefined ? null : { userId: v.userId }), + showArchived: v.showArchived, + withTags: v.withTags, + ...(v.groupBy === undefined ? null : { groupBy: v.groupBy }), + }; + }); +} diff --git a/typescript/src/models/operations/getosanalytics.ts b/typescript/src/models/operations/getosanalytics.ts new file mode 100644 index 00000000..bf547a8e --- /dev/null +++ b/typescript/src/models/operations/getosanalytics.ts @@ -0,0 +1,485 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The interval to retrieve analytics for. + */ +export enum GetOSAnalyticsQueryParamInterval { + Oneh = "1h", + TwentyFourh = "24h", + Sevend = "7d", + Thirtyd = "30d", + Ninetyd = "90d", + All = "all", +} + +/** + * The country to retrieve analytics for. + */ +export enum GetOSAnalyticsQueryParamCountry { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetOSAnalyticsRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain of the short link. + */ + domain?: string | undefined; + /** + * The short link slug. + */ + key?: string | undefined; + /** + * The interval to retrieve analytics for. + */ + interval?: GetOSAnalyticsQueryParamInterval | undefined; + /** + * The country to retrieve analytics for. + */ + country?: GetOSAnalyticsQueryParamCountry | undefined; + /** + * The city to retrieve analytics for. + */ + city?: string | undefined; + /** + * The device to retrieve analytics for. + */ + device?: string | undefined; + /** + * The browser to retrieve analytics for. + */ + browser?: string | undefined; + /** + * The OS to retrieve analytics for. + */ + os?: string | undefined; + /** + * The referer to retrieve analytics for. + */ + referer?: string | undefined; + /** + * The URL to retrieve analytics for. + */ + url?: string | undefined; + /** + * Whether to exclude the root link from the response. + */ + excludeRoot?: boolean | undefined; + /** + * The tag ID to retrieve analytics for. + */ + tagId?: string | undefined; +}; + +export type GetOSAnalyticsResponseBody = { + /** + * The name of the OS + */ + os: string; + /** + * The number of clicks from this OS + */ + clicks: number; +}; + +/** @internal */ +export const GetOSAnalyticsQueryParamInterval$ = z.nativeEnum(GetOSAnalyticsQueryParamInterval); + +/** @internal */ +export const GetOSAnalyticsQueryParamCountry$ = z.nativeEnum(GetOSAnalyticsQueryParamCountry); + +/** @internal */ +export namespace GetOSAnalyticsRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetOSAnalyticsQueryParamInterval | undefined; + country?: GetOSAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetOSAnalyticsQueryParamInterval$.optional(), + country: GetOSAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetOSAnalyticsQueryParamInterval | undefined; + country?: GetOSAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetOSAnalyticsQueryParamInterval$.optional(), + country: GetOSAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); +} + +/** @internal */ +export namespace GetOSAnalyticsResponseBody$ { + export type Inbound = { + os: string; + clicks: number; + }; + + export const inboundSchema: z.ZodType = z + .object({ + os: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + os: v.os, + clicks: v.clicks, + }; + }); + + export type Outbound = { + os: string; + clicks: number; + }; + + export const outboundSchema: z.ZodType = z + .object({ + os: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + os: v.os, + clicks: v.clicks, + }; + }); +} diff --git a/typescript/src/models/operations/getqrcode.ts b/typescript/src/models/operations/getqrcode.ts new file mode 100644 index 00000000..452839c9 --- /dev/null +++ b/typescript/src/models/operations/getqrcode.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The level of error correction to use for the QR code. Defaults to `L` if not provided. + */ +export enum Level { + L = "L", + M = "M", + Q = "Q", + H = "H", +} + +export type GetQRCodeRequest = { + /** + * The URL to generate a QR code for. Defaults to `https://dub.co` if not provided. + */ + url?: string | undefined; + /** + * The size of the QR code in pixels. Defaults to `600` if not provided. + */ + size?: number | undefined; + /** + * The level of error correction to use for the QR code. Defaults to `L` if not provided. + */ + level?: Level | undefined; + /** + * The foreground color of the QR code in hex format. Defaults to `#000000` if not provided. + */ + fgColor?: string | undefined; + /** + * The background color of the QR code in hex format. Defaults to `#ffffff` if not provided. + */ + bgColor?: string | undefined; + /** + * Whether to include a margin around the QR code. Defaults to `false` if not provided. + */ + includeMargin?: boolean | undefined; +}; + +/** @internal */ +export const Level$ = z.nativeEnum(Level); + +/** @internal */ +export namespace GetQRCodeRequest$ { + export type Inbound = { + url?: string | undefined; + size?: number | undefined; + level?: Level | undefined; + fgColor?: string | undefined; + bgColor?: string | undefined; + includeMargin?: boolean | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + url: z.string().default("https://dub.co"), + size: z.number().default(600), + level: Level$.default(Level.L), + fgColor: z.string().default("#000000"), + bgColor: z.string().default("#FFFFFF"), + includeMargin: z.boolean().default(false), + }) + .transform((v) => { + return { + url: v.url, + size: v.size, + level: v.level, + fgColor: v.fgColor, + bgColor: v.bgColor, + includeMargin: v.includeMargin, + }; + }); + + export type Outbound = { + url: string; + size: number; + level: Level; + fgColor: string; + bgColor: string; + includeMargin: boolean; + }; + + export const outboundSchema: z.ZodType = z + .object({ + url: z.string().default("https://dub.co"), + size: z.number().default(600), + level: Level$.default(Level.L), + fgColor: z.string().default("#000000"), + bgColor: z.string().default("#FFFFFF"), + includeMargin: z.boolean().default(false), + }) + .transform((v) => { + return { + url: v.url, + size: v.size, + level: v.level, + fgColor: v.fgColor, + bgColor: v.bgColor, + includeMargin: v.includeMargin, + }; + }); +} diff --git a/typescript/src/models/operations/getrefereranalytics.ts b/typescript/src/models/operations/getrefereranalytics.ts new file mode 100644 index 00000000..a569d789 --- /dev/null +++ b/typescript/src/models/operations/getrefereranalytics.ts @@ -0,0 +1,494 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The interval to retrieve analytics for. + */ +export enum GetRefererAnalyticsQueryParamInterval { + Oneh = "1h", + TwentyFourh = "24h", + Sevend = "7d", + Thirtyd = "30d", + Ninetyd = "90d", + All = "all", +} + +/** + * The country to retrieve analytics for. + */ +export enum GetRefererAnalyticsQueryParamCountry { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetRefererAnalyticsRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain of the short link. + */ + domain?: string | undefined; + /** + * The short link slug. + */ + key?: string | undefined; + /** + * The interval to retrieve analytics for. + */ + interval?: GetRefererAnalyticsQueryParamInterval | undefined; + /** + * The country to retrieve analytics for. + */ + country?: GetRefererAnalyticsQueryParamCountry | undefined; + /** + * The city to retrieve analytics for. + */ + city?: string | undefined; + /** + * The device to retrieve analytics for. + */ + device?: string | undefined; + /** + * The browser to retrieve analytics for. + */ + browser?: string | undefined; + /** + * The OS to retrieve analytics for. + */ + os?: string | undefined; + /** + * The referer to retrieve analytics for. + */ + referer?: string | undefined; + /** + * The URL to retrieve analytics for. + */ + url?: string | undefined; + /** + * Whether to exclude the root link from the response. + */ + excludeRoot?: boolean | undefined; + /** + * The tag ID to retrieve analytics for. + */ + tagId?: string | undefined; +}; + +export type GetRefererAnalyticsResponseBody = { + /** + * The name of the referer. If unknown, this will be `(direct)` + */ + referer: string; + /** + * The number of clicks from this referer + */ + clicks: number; +}; + +/** @internal */ +export const GetRefererAnalyticsQueryParamInterval$ = z.nativeEnum( + GetRefererAnalyticsQueryParamInterval +); + +/** @internal */ +export const GetRefererAnalyticsQueryParamCountry$ = z.nativeEnum( + GetRefererAnalyticsQueryParamCountry +); + +/** @internal */ +export namespace GetRefererAnalyticsRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetRefererAnalyticsQueryParamInterval | undefined; + country?: GetRefererAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetRefererAnalyticsQueryParamInterval$.optional(), + country: GetRefererAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetRefererAnalyticsQueryParamInterval | undefined; + country?: GetRefererAnalyticsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetRefererAnalyticsQueryParamInterval$.optional(), + country: GetRefererAnalyticsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); +} + +/** @internal */ +export namespace GetRefererAnalyticsResponseBody$ { + export type Inbound = { + referer: string; + clicks: number; + }; + + export const inboundSchema: z.ZodType = + z + .object({ + referer: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + referer: v.referer, + clicks: v.clicks, + }; + }); + + export type Outbound = { + referer: string; + clicks: number; + }; + + export const outboundSchema: z.ZodType< + Outbound, + z.ZodTypeDef, + GetRefererAnalyticsResponseBody + > = z + .object({ + referer: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + referer: v.referer, + clicks: v.clicks, + }; + }); +} diff --git a/typescript/src/models/operations/gettags.ts b/typescript/src/models/operations/gettags.ts new file mode 100644 index 00000000..bcd509f8 --- /dev/null +++ b/typescript/src/models/operations/gettags.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type GetTagsRequest = { + /** + * The ID of the workspace to retrieve the tags for. + */ + workspaceId: string; +}; + +/** @internal */ +export namespace GetTagsRequest$ { + export type Inbound = { + workspaceId: string; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + }; + }); + + export type Outbound = { + workspaceId: string; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + }; + }); +} diff --git a/typescript/src/models/operations/gettimeseriesanalytics.ts b/typescript/src/models/operations/gettimeseriesanalytics.ts new file mode 100644 index 00000000..d78c3641 --- /dev/null +++ b/typescript/src/models/operations/gettimeseriesanalytics.ts @@ -0,0 +1,486 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The interval to retrieve analytics for. + */ +export enum QueryParamInterval { + Oneh = "1h", + TwentyFourh = "24h", + Sevend = "7d", + Thirtyd = "30d", + Ninetyd = "90d", + All = "all", +} + +/** + * The country to retrieve analytics for. + */ +export enum QueryParamCountry { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetTimeseriesAnalyticsRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain of the short link. + */ + domain?: string | undefined; + /** + * The short link slug. + */ + key?: string | undefined; + /** + * The interval to retrieve analytics for. + */ + interval?: QueryParamInterval | undefined; + /** + * The country to retrieve analytics for. + */ + country?: QueryParamCountry | undefined; + /** + * The city to retrieve analytics for. + */ + city?: string | undefined; + /** + * The device to retrieve analytics for. + */ + device?: string | undefined; + /** + * The browser to retrieve analytics for. + */ + browser?: string | undefined; + /** + * The OS to retrieve analytics for. + */ + os?: string | undefined; + /** + * The referer to retrieve analytics for. + */ + referer?: string | undefined; + /** + * The URL to retrieve analytics for. + */ + url?: string | undefined; + /** + * Whether to exclude the root link from the response. + */ + excludeRoot?: boolean | undefined; + /** + * The tag ID to retrieve analytics for. + */ + tagId?: string | undefined; +}; + +export type ResponseBody = { + /** + * The starting timestamp of the interval + */ + start: string; + /** + * The number of clicks in the interval + */ + clicks: number; +}; + +/** @internal */ +export const QueryParamInterval$ = z.nativeEnum(QueryParamInterval); + +/** @internal */ +export const QueryParamCountry$ = z.nativeEnum(QueryParamCountry); + +/** @internal */ +export namespace GetTimeseriesAnalyticsRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: QueryParamInterval | undefined; + country?: QueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: QueryParamInterval$.optional(), + country: QueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: QueryParamInterval | undefined; + country?: QueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const outboundSchema: z.ZodType = + z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: QueryParamInterval$.optional(), + country: QueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); +} + +/** @internal */ +export namespace ResponseBody$ { + export type Inbound = { + start: string; + clicks: number; + }; + + export const inboundSchema: z.ZodType = z + .object({ + start: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + start: v.start, + clicks: v.clicks, + }; + }); + + export type Outbound = { + start: string; + clicks: number; + }; + + export const outboundSchema: z.ZodType = z + .object({ + start: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + start: v.start, + clicks: v.clicks, + }; + }); +} diff --git a/typescript/src/models/operations/gettoplinks.ts b/typescript/src/models/operations/gettoplinks.ts new file mode 100644 index 00000000..e803676b --- /dev/null +++ b/typescript/src/models/operations/gettoplinks.ts @@ -0,0 +1,485 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The interval to retrieve analytics for. + */ +export enum GetTopLinksQueryParamInterval { + Oneh = "1h", + TwentyFourh = "24h", + Sevend = "7d", + Thirtyd = "30d", + Ninetyd = "90d", + All = "all", +} + +/** + * The country to retrieve analytics for. + */ +export enum GetTopLinksQueryParamCountry { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetTopLinksRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain of the short link. + */ + domain?: string | undefined; + /** + * The short link slug. + */ + key?: string | undefined; + /** + * The interval to retrieve analytics for. + */ + interval?: GetTopLinksQueryParamInterval | undefined; + /** + * The country to retrieve analytics for. + */ + country?: GetTopLinksQueryParamCountry | undefined; + /** + * The city to retrieve analytics for. + */ + city?: string | undefined; + /** + * The device to retrieve analytics for. + */ + device?: string | undefined; + /** + * The browser to retrieve analytics for. + */ + browser?: string | undefined; + /** + * The OS to retrieve analytics for. + */ + os?: string | undefined; + /** + * The referer to retrieve analytics for. + */ + referer?: string | undefined; + /** + * The URL to retrieve analytics for. + */ + url?: string | undefined; + /** + * Whether to exclude the root link from the response. + */ + excludeRoot?: boolean | undefined; + /** + * The tag ID to retrieve analytics for. + */ + tagId?: string | undefined; +}; + +export type GetTopLinksResponseBody = { + /** + * The unique ID of the short link + */ + link: string; + /** + * The number of clicks from this link + */ + clicks: number; +}; + +/** @internal */ +export const GetTopLinksQueryParamInterval$ = z.nativeEnum(GetTopLinksQueryParamInterval); + +/** @internal */ +export const GetTopLinksQueryParamCountry$ = z.nativeEnum(GetTopLinksQueryParamCountry); + +/** @internal */ +export namespace GetTopLinksRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetTopLinksQueryParamInterval | undefined; + country?: GetTopLinksQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetTopLinksQueryParamInterval$.optional(), + country: GetTopLinksQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetTopLinksQueryParamInterval | undefined; + country?: GetTopLinksQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetTopLinksQueryParamInterval$.optional(), + country: GetTopLinksQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); +} + +/** @internal */ +export namespace GetTopLinksResponseBody$ { + export type Inbound = { + link: string; + clicks: number; + }; + + export const inboundSchema: z.ZodType = z + .object({ + link: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + link: v.link, + clicks: v.clicks, + }; + }); + + export type Outbound = { + link: string; + clicks: number; + }; + + export const outboundSchema: z.ZodType = z + .object({ + link: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + link: v.link, + clicks: v.clicks, + }; + }); +} diff --git a/typescript/src/models/operations/gettopurls.ts b/typescript/src/models/operations/gettopurls.ts new file mode 100644 index 00000000..e8212e69 --- /dev/null +++ b/typescript/src/models/operations/gettopurls.ts @@ -0,0 +1,485 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +/** + * The interval to retrieve analytics for. + */ +export enum GetTopURLsQueryParamInterval { + Oneh = "1h", + TwentyFourh = "24h", + Sevend = "7d", + Thirtyd = "30d", + Ninetyd = "90d", + All = "all", +} + +/** + * The country to retrieve analytics for. + */ +export enum GetTopURLsQueryParamCountry { + Af = "AF", + Al = "AL", + Dz = "DZ", + As = "AS", + Ad = "AD", + Ao = "AO", + Ai = "AI", + Aq = "AQ", + Ag = "AG", + Ar = "AR", + Am = "AM", + Aw = "AW", + Au = "AU", + At = "AT", + Az = "AZ", + Bs = "BS", + Bh = "BH", + Bd = "BD", + Bb = "BB", + By = "BY", + Be = "BE", + Bz = "BZ", + Bj = "BJ", + Bm = "BM", + Bt = "BT", + Bo = "BO", + Ba = "BA", + Bw = "BW", + Bv = "BV", + Br = "BR", + Io = "IO", + Bn = "BN", + Bg = "BG", + Bf = "BF", + Bi = "BI", + Kh = "KH", + Cm = "CM", + Ca = "CA", + Cv = "CV", + Ky = "KY", + Cf = "CF", + Td = "TD", + Cl = "CL", + Cn = "CN", + Cx = "CX", + Cc = "CC", + Co = "CO", + Km = "KM", + Cg = "CG", + Cd = "CD", + Ck = "CK", + Cr = "CR", + Ci = "CI", + Hr = "HR", + Cu = "CU", + Cy = "CY", + Cz = "CZ", + Dk = "DK", + Dj = "DJ", + Dm = "DM", + Do = "DO", + Ec = "EC", + Eg = "EG", + Sv = "SV", + Gq = "GQ", + Er = "ER", + Ee = "EE", + Et = "ET", + Fk = "FK", + Fo = "FO", + Fj = "FJ", + Fi = "FI", + Fr = "FR", + Gf = "GF", + Pf = "PF", + Tf = "TF", + Ga = "GA", + Gm = "GM", + Ge = "GE", + De = "DE", + Gh = "GH", + Gi = "GI", + Gr = "GR", + Gl = "GL", + Gd = "GD", + Gp = "GP", + Gu = "GU", + Gt = "GT", + Gn = "GN", + Gw = "GW", + Gy = "GY", + Ht = "HT", + Hm = "HM", + Va = "VA", + Hn = "HN", + Hk = "HK", + Hu = "HU", + Is = "IS", + In = "IN", + Id = "ID", + Ir = "IR", + Iq = "IQ", + Ie = "IE", + Il = "IL", + It = "IT", + Jm = "JM", + Jp = "JP", + Jo = "JO", + Kz = "KZ", + Ke = "KE", + Ki = "KI", + Kp = "KP", + Kr = "KR", + Kw = "KW", + Kg = "KG", + La = "LA", + Lv = "LV", + Lb = "LB", + Ls = "LS", + Lr = "LR", + Ly = "LY", + Li = "LI", + Lt = "LT", + Lu = "LU", + Mo = "MO", + Mg = "MG", + Mw = "MW", + My = "MY", + Mv = "MV", + Ml = "ML", + Mt = "MT", + Mh = "MH", + Mq = "MQ", + Mr = "MR", + Mu = "MU", + Yt = "YT", + Mx = "MX", + Fm = "FM", + Md = "MD", + Mc = "MC", + Mn = "MN", + Ms = "MS", + Ma = "MA", + Mz = "MZ", + Mm = "MM", + Na = "NA", + Nr = "NR", + Np = "NP", + Nl = "NL", + Nc = "NC", + Nz = "NZ", + Ni = "NI", + Ne = "NE", + Ng = "NG", + Nu = "NU", + Nf = "NF", + Mk = "MK", + Mp = "MP", + No = "NO", + Om = "OM", + Pk = "PK", + Pw = "PW", + Ps = "PS", + Pa = "PA", + Pg = "PG", + Py = "PY", + Pe = "PE", + Ph = "PH", + Pn = "PN", + Pl = "PL", + Pt = "PT", + Pr = "PR", + Qa = "QA", + Re = "RE", + Ro = "RO", + Ru = "RU", + Rw = "RW", + Sh = "SH", + Kn = "KN", + Lc = "LC", + Pm = "PM", + Vc = "VC", + Ws = "WS", + Sm = "SM", + St = "ST", + Sa = "SA", + Sn = "SN", + Sc = "SC", + Sl = "SL", + Sg = "SG", + Sk = "SK", + Si = "SI", + Sb = "SB", + So = "SO", + Za = "ZA", + Gs = "GS", + Es = "ES", + Lk = "LK", + Sd = "SD", + Sr = "SR", + Sj = "SJ", + Sz = "SZ", + Se = "SE", + Ch = "CH", + Sy = "SY", + Tw = "TW", + Tj = "TJ", + Tz = "TZ", + Th = "TH", + Tl = "TL", + Tg = "TG", + Tk = "TK", + To = "TO", + Tt = "TT", + Tn = "TN", + Tr = "TR", + Tm = "TM", + Tc = "TC", + Tv = "TV", + Ug = "UG", + Ua = "UA", + Ae = "AE", + Gb = "GB", + Us = "US", + Um = "UM", + Uy = "UY", + Uz = "UZ", + Vu = "VU", + Ve = "VE", + Vn = "VN", + Vg = "VG", + Vi = "VI", + Wf = "WF", + Eh = "EH", + Ye = "YE", + Zm = "ZM", + Zw = "ZW", + Ax = "AX", + Bq = "BQ", + Cw = "CW", + Gg = "GG", + Im = "IM", + Je = "JE", + Me = "ME", + Bl = "BL", + Mf = "MF", + Rs = "RS", + Sx = "SX", + Ss = "SS", + Xk = "XK", +} + +export type GetTopURLsRequest = { + /** + * The ID of the workspace the link belongs to. + */ + workspaceId: string; + /** + * The domain of the short link. + */ + domain?: string | undefined; + /** + * The short link slug. + */ + key?: string | undefined; + /** + * The interval to retrieve analytics for. + */ + interval?: GetTopURLsQueryParamInterval | undefined; + /** + * The country to retrieve analytics for. + */ + country?: GetTopURLsQueryParamCountry | undefined; + /** + * The city to retrieve analytics for. + */ + city?: string | undefined; + /** + * The device to retrieve analytics for. + */ + device?: string | undefined; + /** + * The browser to retrieve analytics for. + */ + browser?: string | undefined; + /** + * The OS to retrieve analytics for. + */ + os?: string | undefined; + /** + * The referer to retrieve analytics for. + */ + referer?: string | undefined; + /** + * The URL to retrieve analytics for. + */ + url?: string | undefined; + /** + * Whether to exclude the root link from the response. + */ + excludeRoot?: boolean | undefined; + /** + * The tag ID to retrieve analytics for. + */ + tagId?: string | undefined; +}; + +export type GetTopURLsResponseBody = { + /** + * The destination URL + */ + url: string; + /** + * The number of clicks from this URL + */ + clicks: number; +}; + +/** @internal */ +export const GetTopURLsQueryParamInterval$ = z.nativeEnum(GetTopURLsQueryParamInterval); + +/** @internal */ +export const GetTopURLsQueryParamCountry$ = z.nativeEnum(GetTopURLsQueryParamCountry); + +/** @internal */ +export namespace GetTopURLsRequest$ { + export type Inbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetTopURLsQueryParamInterval | undefined; + country?: GetTopURLsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetTopURLsQueryParamInterval$.optional(), + country: GetTopURLsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); + + export type Outbound = { + workspaceId: string; + domain?: string | undefined; + key?: string | undefined; + interval?: GetTopURLsQueryParamInterval | undefined; + country?: GetTopURLsQueryParamCountry | undefined; + city?: string | undefined; + device?: string | undefined; + browser?: string | undefined; + os?: string | undefined; + referer?: string | undefined; + url?: string | undefined; + excludeRoot?: boolean | undefined; + tagId?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + domain: z.string().optional(), + key: z.string().optional(), + interval: GetTopURLsQueryParamInterval$.optional(), + country: GetTopURLsQueryParamCountry$.optional(), + city: z.string().optional(), + device: z.string().optional(), + browser: z.string().optional(), + os: z.string().optional(), + referer: z.string().optional(), + url: z.string().optional(), + excludeRoot: z.boolean().optional(), + tagId: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.domain === undefined ? null : { domain: v.domain }), + ...(v.key === undefined ? null : { key: v.key }), + ...(v.interval === undefined ? null : { interval: v.interval }), + ...(v.country === undefined ? null : { country: v.country }), + ...(v.city === undefined ? null : { city: v.city }), + ...(v.device === undefined ? null : { device: v.device }), + ...(v.browser === undefined ? null : { browser: v.browser }), + ...(v.os === undefined ? null : { os: v.os }), + ...(v.referer === undefined ? null : { referer: v.referer }), + ...(v.url === undefined ? null : { url: v.url }), + ...(v.excludeRoot === undefined ? null : { excludeRoot: v.excludeRoot }), + ...(v.tagId === undefined ? null : { tagId: v.tagId }), + }; + }); +} + +/** @internal */ +export namespace GetTopURLsResponseBody$ { + export type Inbound = { + url: string; + clicks: number; + }; + + export const inboundSchema: z.ZodType = z + .object({ + url: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + url: v.url, + clicks: v.clicks, + }; + }); + + export type Outbound = { + url: string; + clicks: number; + }; + + export const outboundSchema: z.ZodType = z + .object({ + url: z.string(), + clicks: z.number(), + }) + .transform((v) => { + return { + url: v.url, + clicks: v.clicks, + }; + }); +} diff --git a/typescript/src/models/operations/getworkspace.ts b/typescript/src/models/operations/getworkspace.ts new file mode 100644 index 00000000..093102a7 --- /dev/null +++ b/typescript/src/models/operations/getworkspace.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type GetWorkspaceRequest = { + /** + * The ID or slug of the workspace. + */ + idOrSlug: string; +}; + +/** @internal */ +export namespace GetWorkspaceRequest$ { + export type Inbound = { + idOrSlug: string; + }; + + export const inboundSchema: z.ZodType = z + .object({ + idOrSlug: z.string(), + }) + .transform((v) => { + return { + idOrSlug: v.idOrSlug, + }; + }); + + export type Outbound = { + idOrSlug: string; + }; + + export const outboundSchema: z.ZodType = z + .object({ + idOrSlug: z.string(), + }) + .transform((v) => { + return { + idOrSlug: v.idOrSlug, + }; + }); +} diff --git a/typescript/src/models/operations/index.ts b/typescript/src/models/operations/index.ts new file mode 100644 index 00000000..93a19cf6 --- /dev/null +++ b/typescript/src/models/operations/index.ts @@ -0,0 +1,26 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +export * from "./bulkcreatelinks"; +export * from "./createlink"; +export * from "./createtag"; +export * from "./createworkspace"; +export * from "./deletelink"; +export * from "./editlink"; +export * from "./getbrowseranalytics"; +export * from "./getcityanalytics"; +export * from "./getclicksanalytics"; +export * from "./getcountryanalytics"; +export * from "./getdeviceanalytics"; +export * from "./getlinkinfo"; +export * from "./getlinks"; +export * from "./getlinkscount"; +export * from "./getosanalytics"; +export * from "./getqrcode"; +export * from "./getrefereranalytics"; +export * from "./gettags"; +export * from "./gettimeseriesanalytics"; +export * from "./gettoplinks"; +export * from "./gettopurls"; +export * from "./getworkspace"; diff --git a/typescript/src/sdk/analytics.ts b/typescript/src/sdk/analytics.ts new file mode 100644 index 00000000..4d5219b3 --- /dev/null +++ b/typescript/src/sdk/analytics.ts @@ -0,0 +1,2493 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { SDKHooks } from "../hooks"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; +import * as enc$ from "../lib/encodings"; +import { HTTPClient } from "../lib/http"; +import * as schemas$ from "../lib/schemas"; +import { ClientSDK, RequestOptions } from "../lib/sdks"; +import * as errors from "../models/errors"; +import * as operations from "../models/operations"; +import * as z from "zod"; + +export class Analytics extends ClientSDK { + private readonly options$: SDKOptions & { hooks?: SDKHooks }; + + constructor(options: SDKOptions = {}) { + const opt = options as unknown; + let hooks: SDKHooks; + if ( + typeof opt === "object" && + opt != null && + "hooks" in opt && + opt.hooks instanceof SDKHooks + ) { + hooks = opt.hooks; + } else { + hooks = new SDKHooks(); + } + + super({ + client: options.httpClient || new HTTPClient(), + baseURL: serverURLFromOptions(options), + hooks, + }); + + this.options$ = { ...options, hooks }; + void this.options$; + } + + /** + * Retrieve clicks analytics + * + * @remarks + * Retrieve the number of clicks for a link, a domain, or the authenticated workspace. + */ + async getClicksAnalytics( + input: operations.GetClicksAnalyticsRequest, + options?: RequestOptions + ): Promise { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetClicksAnalyticsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/analytics/clicks")(); + + const query$ = [ + enc$.encodeForm("browser", payload$.browser, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("city", payload$.city, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("country", payload$.country, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("excludeRoot", payload$.excludeRoot, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("interval", payload$.interval, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("os", payload$.os, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("referer", payload$.referer, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getClicksAnalytics", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z.number().parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve timeseries analytics + * + * @remarks + * Retrieve the number of clicks for a link, a domain, or the authenticated workspace over a period of time. + */ + async getTimeseriesAnalytics( + input: operations.GetTimeseriesAnalyticsRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetTimeseriesAnalyticsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/analytics/timeseries")(); + + const query$ = [ + enc$.encodeForm("browser", payload$.browser, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("city", payload$.city, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("country", payload$.country, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("excludeRoot", payload$.excludeRoot, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("interval", payload$.interval, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("os", payload$.os, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("referer", payload$.referer, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getTimeseriesAnalytics", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z.array(operations.ResponseBody$.inboundSchema).parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve country analytics + * + * @remarks + * Retrieve the top countries by number of clicks for a link, a domain, or the authenticated workspace. + */ + async getCountryAnalytics( + input: operations.GetCountryAnalyticsRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetCountryAnalyticsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/analytics/country")(); + + const query$ = [ + enc$.encodeForm("browser", payload$.browser, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("city", payload$.city, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("country", payload$.country, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("excludeRoot", payload$.excludeRoot, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("interval", payload$.interval, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("os", payload$.os, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("referer", payload$.referer, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getCountryAnalytics", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z + .array(operations.GetCountryAnalyticsResponseBody$.inboundSchema) + .parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve city analytics + * + * @remarks + * Retrieve the top countries by number of clicks for a link, a domain, or the authenticated workspace. + */ + async getCityAnalytics( + input: operations.GetCityAnalyticsRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetCityAnalyticsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/analytics/city")(); + + const query$ = [ + enc$.encodeForm("browser", payload$.browser, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("city", payload$.city, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("country", payload$.country, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("excludeRoot", payload$.excludeRoot, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("interval", payload$.interval, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("os", payload$.os, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("referer", payload$.referer, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getCityAnalytics", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z + .array(operations.GetCityAnalyticsResponseBody$.inboundSchema) + .parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve device analytics + * + * @remarks + * Retrieve the top devices by number of clicks for a link, a domain, or the authenticated workspace. + */ + async getDeviceAnalytics( + input: operations.GetDeviceAnalyticsRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetDeviceAnalyticsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/analytics/device")(); + + const query$ = [ + enc$.encodeForm("browser", payload$.browser, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("city", payload$.city, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("country", payload$.country, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("excludeRoot", payload$.excludeRoot, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("interval", payload$.interval, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("os", payload$.os, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("referer", payload$.referer, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getDeviceAnalytics", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z + .array(operations.GetDeviceAnalyticsResponseBody$.inboundSchema) + .parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve browser analytics + * + * @remarks + * Retrieve the top browsers by number of clicks for a link, a domain, or the authenticated workspace. + */ + async getBrowserAnalytics( + input: operations.GetBrowserAnalyticsRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetBrowserAnalyticsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/analytics/browser")(); + + const query$ = [ + enc$.encodeForm("browser", payload$.browser, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("city", payload$.city, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("country", payload$.country, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("excludeRoot", payload$.excludeRoot, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("interval", payload$.interval, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("os", payload$.os, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("referer", payload$.referer, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getBrowserAnalytics", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z + .array(operations.GetBrowserAnalyticsResponseBody$.inboundSchema) + .parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve OS analytics + * + * @remarks + * Retrieve the top OS by number of clicks for a link, a domain, or the authenticated workspace. + */ + async getOSAnalytics( + input: operations.GetOSAnalyticsRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetOSAnalyticsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/analytics/os")(); + + const query$ = [ + enc$.encodeForm("browser", payload$.browser, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("city", payload$.city, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("country", payload$.country, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("excludeRoot", payload$.excludeRoot, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("interval", payload$.interval, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("os", payload$.os, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("referer", payload$.referer, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getOSAnalytics", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z + .array(operations.GetOSAnalyticsResponseBody$.inboundSchema) + .parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve referer analytics + * + * @remarks + * Retrieve the top referers by number of clicks for a link, a domain, or the authenticated workspace. + */ + async getRefererAnalytics( + input: operations.GetRefererAnalyticsRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetRefererAnalyticsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/analytics/referer")(); + + const query$ = [ + enc$.encodeForm("browser", payload$.browser, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("city", payload$.city, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("country", payload$.country, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("excludeRoot", payload$.excludeRoot, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("interval", payload$.interval, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("os", payload$.os, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("referer", payload$.referer, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getRefererAnalytics", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z + .array(operations.GetRefererAnalyticsResponseBody$.inboundSchema) + .parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve top links + * + * @remarks + * Retrieve the top links by number of clicks for a domain or the authenticated workspace. + */ + async getTopLinks( + input: operations.GetTopLinksRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetTopLinksRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/analytics/top_links")(); + + const query$ = [ + enc$.encodeForm("browser", payload$.browser, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("city", payload$.city, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("country", payload$.country, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("excludeRoot", payload$.excludeRoot, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("interval", payload$.interval, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("os", payload$.os, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("referer", payload$.referer, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getTopLinks", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z.array(operations.GetTopLinksResponseBody$.inboundSchema).parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve top URLs + * + * @remarks + * Retrieve the top URLs by number of clicks for a given short link. + */ + async getTopURLs( + input: operations.GetTopURLsRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetTopURLsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/analytics/top_urls")(); + + const query$ = [ + enc$.encodeForm("browser", payload$.browser, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("city", payload$.city, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("country", payload$.country, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("device", payload$.device, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("excludeRoot", payload$.excludeRoot, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("interval", payload$.interval, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("os", payload$.os, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("referer", payload$.referer, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getTopURLs", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z.array(operations.GetTopURLsResponseBody$.inboundSchema).parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } +} diff --git a/typescript/src/sdk/index.ts b/typescript/src/sdk/index.ts new file mode 100644 index 00000000..31303148 --- /dev/null +++ b/typescript/src/sdk/index.ts @@ -0,0 +1,5 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +export * from "./sdk"; diff --git a/typescript/src/sdk/links.ts b/typescript/src/sdk/links.ts new file mode 100644 index 00000000..d6315138 --- /dev/null +++ b/typescript/src/sdk/links.ts @@ -0,0 +1,1610 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { SDKHooks } from "../hooks"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; +import * as enc$ from "../lib/encodings"; +import { HTTPClient } from "../lib/http"; +import * as schemas$ from "../lib/schemas"; +import { ClientSDK, RequestOptions } from "../lib/sdks"; +import * as components from "../models/components"; +import * as errors from "../models/errors"; +import * as operations from "../models/operations"; +import * as z from "zod"; + +export class Links extends ClientSDK { + private readonly options$: SDKOptions & { hooks?: SDKHooks }; + + constructor(options: SDKOptions = {}) { + const opt = options as unknown; + let hooks: SDKHooks; + if ( + typeof opt === "object" && + opt != null && + "hooks" in opt && + opt.hooks instanceof SDKHooks + ) { + hooks = opt.hooks; + } else { + hooks = new SDKHooks(); + } + + super({ + client: options.httpClient || new HTTPClient(), + baseURL: serverURLFromOptions(options), + hooks, + }); + + this.options$ = { ...options, hooks }; + void this.options$; + } + + /** + * Retrieve a list of links + * + * @remarks + * Retrieve a list of links for the authenticated workspace. The list will be paginated and the provided query parameters allow filtering the returned links. + */ + async getLinks( + input: operations.GetLinksRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetLinksRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/links")(); + + const query$ = [ + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("page", payload$.page, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("search", payload$.search, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("showArchived", payload$.showArchived, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("sort", payload$.sort, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("tagIds", payload$.tagIds, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("userId", payload$.userId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("withTags", payload$.withTags, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getLinks", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z.array(components.LinkSchema$.inboundSchema).parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Create a new link + * + * @remarks + * Create a new link for the authenticated workspace. + */ + async createLink( + input: operations.CreateLinkRequest, + options?: RequestOptions + ): Promise { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Content-Type", "application/json"); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.CreateLinkRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + + const path$ = this.templateURLComponent("/links")(); + + const query$ = [ + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "createLink", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return components.LinkSchema$.inboundSchema.parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve the number of links + * + * @remarks + * Retrieve the number of links for the authenticated workspace. The provided query parameters allow filtering the returned links. + */ + async getLinksCount( + input: operations.GetLinksCountRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetLinksCountRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/links/count")(); + + const query$ = [ + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("groupBy", payload$.groupBy, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("search", payload$.search, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("showArchived", payload$.showArchived, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("tagIds", payload$.tagIds, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("userId", payload$.userId, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("withTags", payload$.withTags, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getLinksCount", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z.array(components.LinkSchema$.inboundSchema).parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve a link + * + * @remarks + * Retrieve the info for a link from their domain and key. + */ + async getLinkInfo( + input: operations.GetLinkInfoRequest, + options?: RequestOptions + ): Promise { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetLinkInfoRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/links/info")(); + + const query$ = [ + enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getLinkInfo", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return components.LinkSchema$.inboundSchema.parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Edit a link + * + * @remarks + * Edit a link for the authenticated workspace. + */ + async editLink( + input: operations.EditLinkRequest, + options?: RequestOptions + ): Promise { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Content-Type", "application/json"); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.EditLinkRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + linkId: enc$.encodeSimple("linkId", payload$.linkId, { + explode: false, + charEncoding: "percent", + }), + }; + const path$ = this.templateURLComponent("/links/{linkId}")(pathParams$); + + const query$ = [ + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "editLink", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "PUT", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return components.LinkSchema$.inboundSchema.parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Delete a link + * + * @remarks + * Delete a link for the authenticated workspace. + */ + async deleteLink( + input: operations.DeleteLinkRequest, + options?: RequestOptions + ): Promise { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.DeleteLinkRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const pathParams$ = { + linkId: enc$.encodeSimple("linkId", payload$.linkId, { + explode: false, + charEncoding: "percent", + }), + }; + const path$ = this.templateURLComponent("/links/{linkId}")(pathParams$); + + const query$ = [ + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "deleteLink", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return components.LinkSchema$.inboundSchema.parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Bulk create links + * + * @remarks + * Bulk create up to 100 links for the authenticated workspace. + */ + async bulkCreateLinks( + input: operations.BulkCreateLinksRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Content-Type", "application/json"); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.BulkCreateLinksRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + + const path$ = this.templateURLComponent("/links/bulk")(); + + const query$ = [ + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "bulkCreateLinks", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z.array(components.LinkSchema$.inboundSchema).parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } +} diff --git a/typescript/src/sdk/qrcodes.ts b/typescript/src/sdk/qrcodes.ts new file mode 100644 index 00000000..d460314c --- /dev/null +++ b/typescript/src/sdk/qrcodes.ts @@ -0,0 +1,276 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { SDKHooks } from "../hooks"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; +import * as enc$ from "../lib/encodings"; +import { HTTPClient } from "../lib/http"; +import * as schemas$ from "../lib/schemas"; +import { ClientSDK, RequestOptions } from "../lib/sdks"; +import * as errors from "../models/errors"; +import * as operations from "../models/operations"; +import * as z from "zod"; + +export enum GetQRCodeAcceptEnum { + applicationJson = "application/json", + imagePng = "image/png", +} + +export class QRCodes extends ClientSDK { + private readonly options$: SDKOptions & { hooks?: SDKHooks }; + + constructor(options: SDKOptions = {}) { + const opt = options as unknown; + let hooks: SDKHooks; + if ( + typeof opt === "object" && + opt != null && + "hooks" in opt && + opt.hooks instanceof SDKHooks + ) { + hooks = opt.hooks; + } else { + hooks = new SDKHooks(); + } + + super({ + client: options.httpClient || new HTTPClient(), + baseURL: serverURLFromOptions(options), + hooks, + }); + + this.options$ = { ...options, hooks }; + void this.options$; + } + + /** + * Retrieve a QR code + * + * @remarks + * Retrieve a QR code for a link. + */ + async getQRCode( + input: operations.GetQRCodeRequest, + options?: RequestOptions & { acceptHeaderOverride?: GetQRCodeAcceptEnum } + ): Promise { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + + const accept = options?.acceptHeaderOverride || "application/json;q=1, image/png;q=0"; + headers$.set("Accept", accept); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetQRCodeRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/qr")(); + + const query$ = [ + enc$.encodeForm("bgColor", payload$.bgColor, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("fgColor", payload$.fgColor, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("includeMargin", payload$.includeMargin, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("level", payload$.level, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("size", payload$.size, { explode: true, charEncoding: "percent" }), + enc$.encodeForm("url", payload$.url, { explode: true, charEncoding: "percent" }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getQRCode", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "image/png")) { + const responseBody = await response.text(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z.string().parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } +} diff --git a/typescript/src/sdk/sdk.ts b/typescript/src/sdk/sdk.ts new file mode 100644 index 00000000..091c1abe --- /dev/null +++ b/typescript/src/sdk/sdk.ts @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { SDKHooks } from "../hooks"; +import { SDKOptions, serverURLFromOptions } from "../lib/config"; +import { HTTPClient } from "../lib/http"; +import { ClientSDK } from "../lib/sdks"; +import { Analytics } from "./analytics"; +import { Links } from "./links"; +import { QRCodes } from "./qrcodes"; +import { Tags } from "./tags"; +import { Workspaces } from "./workspaces"; + +export class Dub extends ClientSDK { + private readonly options$: SDKOptions & { hooks?: SDKHooks }; + + constructor(options: SDKOptions = {}) { + const opt = options as unknown; + let hooks: SDKHooks; + if ( + typeof opt === "object" && + opt != null && + "hooks" in opt && + opt.hooks instanceof SDKHooks + ) { + hooks = opt.hooks; + } else { + hooks = new SDKHooks(); + } + + super({ + client: options.httpClient || new HTTPClient(), + baseURL: serverURLFromOptions(options), + hooks, + }); + + this.options$ = { ...options, hooks }; + void this.options$; + } + + private _links?: Links; + get links() { + return (this._links ??= new Links(this.options$)); + } + + private _qrCodes?: QRCodes; + get qrCodes() { + return (this._qrCodes ??= new QRCodes(this.options$)); + } + + private _analytics?: Analytics; + get analytics() { + return (this._analytics ??= new Analytics(this.options$)); + } + + private _workspaces?: Workspaces; + get workspaces() { + return (this._workspaces ??= new Workspaces(this.options$)); + } + + private _tags?: Tags; + get tags() { + return (this._tags ??= new Tags(this.options$)); + } +} diff --git a/typescript/src/sdk/tags.ts b/typescript/src/sdk/tags.ts new file mode 100644 index 00000000..6ca2bd9f --- /dev/null +++ b/typescript/src/sdk/tags.ts @@ -0,0 +1,477 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { SDKHooks } from "../hooks"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; +import * as enc$ from "../lib/encodings"; +import { HTTPClient } from "../lib/http"; +import * as schemas$ from "../lib/schemas"; +import { ClientSDK, RequestOptions } from "../lib/sdks"; +import * as components from "../models/components"; +import * as errors from "../models/errors"; +import * as operations from "../models/operations"; +import * as z from "zod"; + +export class Tags extends ClientSDK { + private readonly options$: SDKOptions & { hooks?: SDKHooks }; + + constructor(options: SDKOptions = {}) { + const opt = options as unknown; + let hooks: SDKHooks; + if ( + typeof opt === "object" && + opt != null && + "hooks" in opt && + opt.hooks instanceof SDKHooks + ) { + hooks = opt.hooks; + } else { + hooks = new SDKHooks(); + } + + super({ + client: options.httpClient || new HTTPClient(), + baseURL: serverURLFromOptions(options), + hooks, + }); + + this.options$ = { ...options, hooks }; + void this.options$; + } + + /** + * Retrieve a list of tags + * + * @remarks + * Retrieve a list of tags for the authenticated workspace. + */ + async getTags( + input: operations.GetTagsRequest, + options?: RequestOptions + ): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetTagsRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const path$ = this.templateURLComponent("/tags")(); + + const query$ = [ + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getTags", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z.array(components.TagSchema$.inboundSchema).parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Create a new tag + * + * @remarks + * Create a new tag for the authenticated workspace. + */ + async createTag( + input: operations.CreateTagRequest, + options?: RequestOptions + ): Promise { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Content-Type", "application/json"); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.CreateTagRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + + const path$ = this.templateURLComponent("/tags")(); + + const query$ = [ + enc$.encodeForm("workspaceId", payload$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "createTag", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 201, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return components.TagSchema$.inboundSchema.parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } +} diff --git a/typescript/src/sdk/workspaces.ts b/typescript/src/sdk/workspaces.ts new file mode 100644 index 00000000..8c178b76 --- /dev/null +++ b/typescript/src/sdk/workspaces.ts @@ -0,0 +1,670 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import { SDKHooks } from "../hooks"; +import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; +import * as enc$ from "../lib/encodings"; +import { HTTPClient } from "../lib/http"; +import * as schemas$ from "../lib/schemas"; +import { ClientSDK, RequestOptions } from "../lib/sdks"; +import * as components from "../models/components"; +import * as errors from "../models/errors"; +import * as operations from "../models/operations"; +import * as z from "zod"; + +export class Workspaces extends ClientSDK { + private readonly options$: SDKOptions & { hooks?: SDKHooks }; + + constructor(options: SDKOptions = {}) { + const opt = options as unknown; + let hooks: SDKHooks; + if ( + typeof opt === "object" && + opt != null && + "hooks" in opt && + opt.hooks instanceof SDKHooks + ) { + hooks = opt.hooks; + } else { + hooks = new SDKHooks(); + } + + super({ + client: options.httpClient || new HTTPClient(), + baseURL: serverURLFromOptions(options), + hooks, + }); + + this.options$ = { ...options, hooks }; + void this.options$; + } + + /** + * Retrieve a list of workspaces + * + * @remarks + * Retrieve a list of workspaces for the authenticated user. + */ + async getWorkspaces(options?: RequestOptions): Promise> { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const path$ = this.templateURLComponent("/workspaces")(); + + const query$ = ""; + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getWorkspaces", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return z.array(components.WorkspaceSchema$.inboundSchema).parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Create a workspace + * + * @remarks + * Create a new workspace for the authenticated user. + */ + async createWorkspace( + input: operations.CreateWorkspaceRequestBody | undefined, + options?: RequestOptions + ): Promise { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Content-Type", "application/json"); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => + operations.CreateWorkspaceRequestBody$.outboundSchema.optional().parse(value$), + "Input validation failed" + ); + const body$ = + payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true }); + + const path$ = this.templateURLComponent("/workspaces")(); + + const query$ = ""; + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "createWorkspace", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return components.WorkspaceSchema$.inboundSchema.parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } + + /** + * Retrieve a workspace + * + * @remarks + * Retrieve a workspace for the authenticated user. + */ + async getWorkspace( + input: operations.GetWorkspaceRequest, + options?: RequestOptions + ): Promise { + const headers$ = new Headers(); + headers$.set("user-agent", SDK_METADATA.userAgent); + headers$.set("Accept", "application/json"); + + const payload$ = schemas$.parse( + input, + (value$) => operations.GetWorkspaceRequest$.outboundSchema.parse(value$), + "Input validation failed" + ); + const body$ = null; + + const pathParams$ = { + idOrSlug: enc$.encodeSimple("idOrSlug", payload$.idOrSlug, { + explode: false, + charEncoding: "percent", + }), + }; + const path$ = this.templateURLComponent("/workspaces/{idOrSlug}")(pathParams$); + + const query$ = ""; + + let security$; + if (typeof this.options$.bearerToken === "function") { + security$ = { bearerToken: await this.options$.bearerToken() }; + } else if (this.options$.bearerToken) { + security$ = { bearerToken: this.options$.bearerToken }; + } else { + security$ = {}; + } + const context = { + operationID: "getWorkspace", + oAuth2Scopes: [], + securitySource: this.options$.bearerToken, + }; + const securitySettings$ = this.resolveGlobalSecurity(security$); + + const doOptions = { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + }; + const request = this.createRequest$( + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + }, + options + ); + + const response = await this.do$(request, doOptions); + + const responseFields$ = { + HttpMeta: { + Response: response, + Request: request, + }, + }; + + if (this.matchResponse(response, 200, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return components.WorkspaceSchema$.inboundSchema.parse(val$); + }, + "Response validation failed" + ); + return result; + } else if (this.matchResponse(response, 400, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 401, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndOne$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 403, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndThree$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 404, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndFour$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 409, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 410, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTen$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 422, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyTwo$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 429, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FourHundredAndTwentyNine$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else if (this.matchResponse(response, 500, "application/json")) { + const responseBody = await response.json(); + const result = schemas$.parse( + responseBody, + (val$) => { + return errors.FiveHundred$.inboundSchema.parse({ + ...responseFields$, + ...val$, + }); + }, + "Response validation failed" + ); + throw result; + } else { + const responseBody = await response.text(); + throw new errors.SDKError("Unexpected API response", response, responseBody); + } + } +} diff --git a/typescript/src/types/blobs.ts b/typescript/src/types/blobs.ts new file mode 100644 index 00000000..2c21e410 --- /dev/null +++ b/typescript/src/types/blobs.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +import * as z from "zod"; + +export const blobLikeSchema = z.custom(isBlobLike, { + message: "expected a Blob, File or Blob-like object", + fatal: true, +}); + +export function isBlobLike(val: unknown): val is Blob { + if (val instanceof Blob) { + return true; + } + + if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { + return false; + } + + const name = val[Symbol.toStringTag]; + if (typeof name !== "string") { + return false; + } + if (name !== "Blob" && name !== "File") { + return false; + } + + return "stream" in val && typeof val.stream === "function"; +} diff --git a/typescript/src/types/index.ts b/typescript/src/types/index.ts new file mode 100644 index 00000000..3937ae70 --- /dev/null +++ b/typescript/src/types/index.ts @@ -0,0 +1,8 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +export { RFCDate } from "./rfcdate"; +export { blobLikeSchema, isBlobLike } from "./blobs"; +export type { Paginator, PageIterator } from "./operations"; +export { createPageIterator } from "./operations"; diff --git a/typescript/src/types/operations.ts b/typescript/src/types/operations.ts new file mode 100644 index 00000000..8e38c2fc --- /dev/null +++ b/typescript/src/types/operations.ts @@ -0,0 +1,25 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +export type Paginator = () => Promise> | null; + +export type PageIterator = Result & { + next: Paginator; + [Symbol.asyncIterator]: () => AsyncIterableIterator; +}; + +export function createPageIterator( + page: Result & { next: Paginator }, +) { + return { + [Symbol.asyncIterator]: async function* paginator() { + yield page; + + let p: typeof page | null = page; + for (p = await p.next(); p != null; p = await p.next()) { + yield p; + } + }, + }; +} diff --git a/typescript/src/types/rfcdate.ts b/typescript/src/types/rfcdate.ts new file mode 100644 index 00000000..c37d292b --- /dev/null +++ b/typescript/src/types/rfcdate.ts @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + */ + +const dateRE = /^\d{4}-\d{2}-\d{2}$/; + +export class RFCDate { + private serialized: string; + + /** + * Creates a new RFCDate instance using today's date. + */ + static today() { + return new RFCDate(new Date()); + } + + /** + * Creates a new RFCDate instance using the provided input. + * If a string is used then in must be in the format YYYY-MM-DD. + * + * @param date A Date object or a date string in YYYY-MM-DD format + * @example + * new RFCDate("2022-01-01") + * @example + * new RFCDate(new Date()) + */ + constructor(date: Date | string) { + if (typeof date === "string" && !dateRE.test(date)) { + throw new RangeError( + "RFCDate: date strings must be in the format YYYY-MM-DD: " + date, + ); + } + + const value = new Date(date); + if (isNaN(+value)) { + throw new RangeError("RFCDate: invalid date provided: " + date); + } + + this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length); + if (!dateRE.test(this.serialized)) { + throw new TypeError( + `RFCDate: failed to build valid date with given value: ${date} serialized to ${this.serialized}`, + ); + } + } + + toJSON(): string { + return this.toString(); + } + + toString(): string { + return this.serialized; + } +} diff --git a/typescript/tests/links.test.ts b/typescript/tests/links.test.ts new file mode 100644 index 00000000..51d059d0 --- /dev/null +++ b/typescript/tests/links.test.ts @@ -0,0 +1,168 @@ +import { Dub } from "../src" +import * as errors from "../src/models/errors"; +import { expect, test, describe, beforeAll } from 'vitest' +import { Color } from "../src/models/operations"; + +const dubWorkspace = { + name: "Dub Workspace", + slug: "dub-workspace" +} + +const token = "tZ6ECyDkA21K9jrMn8EOkajh"; +const workspaceId = "ws_clur5mtu10004jb3oqz83lpxo"; + +const domain = "a.com" +const url = "https://github.com/dubinc/dub" +const key = Math.random().toString(36).substring(7); +const tagName = Math.random().toString(36).substring(7); + +const dub = new Dub({ token, workspaceId }); + +describe('SDK Methods', () => { + beforeAll(async () => { + const links = await dub.links.list({}); + const promises = links.map((link) => dub.links.delete(link.id)) + await Promise.allSettled(promises); + }) + + test('get QR code', async () => { + const qrCode = await dub.qrCodes.get({ url }); + expect(qrCode).toBeDefined(); + }); + + test('create workspace', async () => { + const workspace = await dub.workspaces.create({ + name: dubWorkspace.name, + slug: dubWorkspace.slug + }); + + expect(workspace).toBeDefined(); + expect(workspace.name).toBe(dubWorkspace.name); + expect(workspace.slug).toBe(dubWorkspace.slug); + }); + + test('retrieve workspace', async () => { + const workspace = await dub.workspaces.get({ idOrSlug: dubWorkspace.slug}); + + expect(workspace).toBeDefined(); + expect(workspace.name).toBe(dubWorkspace.name); + expect(workspace.slug).toBe(dubWorkspace.slug); + }); + + test('list workspaces', async () => { + const workspaces = await dub.workspaces.list({}); + + const expectedWorkspace = workspaces.find((workspace) => workspace.slug === dubWorkspace.slug); + + expect(workspaces).toBeDefined(); + expect(workspaces.length).greaterThan(0); + expect(expectedWorkspace).toBeDefined() + }); + + test('create tag', async () => { + const tag = await dub.tags.create({tag: tagName, color: Color.Red}); + + expect(tag).toBeDefined(); + expect(tag.name).toBe(tagName); + expect(tag.color).toBe(Color.Red); + }); + + test('retrieve tags', async () => { + const tags = await dub.tags.list({}); + + const expectedTag = tags.find((tag) => tag.name === tagName); + + expect(tags).toBeDefined(); + expect(tags.length).greaterThan(0); + expect(expectedTag).toBeDefined() + }) + + test('create link', async () => { + const link = await dub.links.create({url, key, domain}); + + expect(link).toBeDefined(); + expect(link.url).toBe(url); + expect(link.key).toBe(key); + expect(link.workspaceId).toBe(workspaceId); + }); + + test('get link info', async () => { + const link = await dub.links.get({ domain, key }); + + expect(link).toBeDefined(); + expect(link.url).toBe(url); + expect(link.key).toBe(key); + expect(link.domain).toBe(domain); + expect(link.workspaceId).toBe(workspaceId); + }); + + test('retrieve links', async () => { + const links = await dub.links.list({}); + + expect(links).toBeDefined(); + expect(links.length).toEqual(1); + expect(links[0].url).toBe(url); + expect(links[0].key).toBe(key); + expect(links[0].domain).toBe(domain); + expect(links[0].workspaceId).toBe(workspaceId); + }); + + test('update link', async () => { + const link = await dub.links.get({ domain, key }); + + const updatedLink = await dub.links.update(link.id, { + comments: "This is a test link", + url, + }); + + expect(updatedLink).toBeDefined(); + expect(updatedLink.url).toBe(url); + expect(updatedLink.key).toBe(key); + expect(updatedLink.domain).toBe(domain); + expect(updatedLink.workspaceId).toBe(workspaceId); + expect(updatedLink.comments).toBe("This is a test link"); + }) + + test('number of links', async () => { + const count = await dub.links.count({}); + + expect(count).toBeDefined(); + expect(count).toBe(1); + }) + + test('delete link', async () => { + const link = await dub.links.get({ domain, key }); + + const deletedLink = await dub.links.delete(link.id); + + expect(deletedLink).toBeDefined(); + expect(deletedLink.id).toBe(link.id); + + try { + // Check if the link is deleted + await dub.links.get({ domain, key }); + } catch (error) { + expect(error).toBeInstanceOf(errors.NotFound); + } + }) + + test('bulk create link', async () => { + const key1 = Math.random().toString(36).substring(7); + const key2 = Math.random().toString(36).substring(7); + + const links = await dub.links.bulkCreate([{url, domain, key: key1}, {url, domain, key: key2}]); + + expect(links).toBeDefined(); + expect(links.length).toEqual(2); + expect(links[0].url).toBe(url); + expect(links[0].key).toBe(key1); + expect(links[0].domain).toBe(domain); + expect(links[0].workspaceId).toBe(workspaceId) + expect(links[1].url).toBe(url); + expect(links[1].key).toBe(key2); + expect(links[1].domain).toBe(domain); + expect(links[1].workspaceId).toBe(workspaceId) + }); + + +}) \ No newline at end of file diff --git a/typescript/tsconfig.json b/typescript/tsconfig.json new file mode 100644 index 00000000..7a86d2d9 --- /dev/null +++ b/typescript/tsconfig.json @@ -0,0 +1,40 @@ +{ + "compilerOptions": { + "incremental": true, + "tsBuildInfoFile": ".tsbuildinfo", + "target": "ES2018", + "lib": ["ES2022", "DOM", "DOM.Iterable"], + + "module": "Node16", + "moduleResolution": "Node16", + + "allowJs": true, + + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": ".", + + + // https://github.com/tsconfig/bases/blob/a1bf7c0fa2e094b068ca3e1448ca2ece4157977e/bases/strictest.json + "strict": true, + "allowUnusedLabels": false, + "allowUnreachableCode": false, + "exactOptionalPropertyTypes": true, + "useUnknownInCatchVariables": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": true, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "isolatedModules": true, + "checkJs": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "include": ["src"], + "exclude": ["node_modules"] +}