dub 0.10.0 → 0.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/sdk_generation.yaml +26 -0
- package/.github/workflows/sdk_publish.yaml +15 -0
- package/.speakeasy/gen.lock +205 -0
- package/.speakeasy/gen.yaml +37 -0
- package/.speakeasy/workflow.yaml +12 -0
- package/README.md +292 -182
- package/docs/sdks/analytics/README.md +535 -0
- package/docs/sdks/dub/README.md +9 -0
- package/docs/sdks/links/README.md +415 -0
- package/docs/sdks/qrcodes/README.md +58 -0
- package/docs/sdks/tags/README.md +113 -0
- package/docs/sdks/workspaces/README.md +168 -0
- package/hooks/hooks.d.ts +20 -0
- package/hooks/hooks.d.ts.map +1 -0
- package/hooks/hooks.js +55 -0
- package/hooks/hooks.js.map +1 -0
- package/hooks/index.d.ts +3 -0
- package/hooks/index.d.ts.map +1 -0
- package/{_shims/auto/runtime-bun.js → hooks/index.js} +6 -5
- package/hooks/index.js.map +1 -0
- package/hooks/types.d.ts +59 -0
- package/hooks/types.d.ts.map +1 -0
- package/hooks/types.js +6 -0
- package/hooks/types.js.map +1 -0
- package/index.d.ts +4 -125
- package/index.d.ts.map +1 -1
- package/index.js +10 -103
- package/index.js.map +1 -1
- package/lib/base64.d.ts +10 -0
- package/lib/base64.d.ts.map +1 -0
- package/lib/base64.js +61 -0
- package/lib/base64.js.map +1 -0
- package/lib/config.d.ts +39 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +39 -0
- package/lib/config.js.map +1 -0
- package/lib/encodings.d.ts +39 -0
- package/lib/encodings.d.ts.map +1 -0
- package/lib/encodings.js +311 -0
- package/lib/encodings.js.map +1 -0
- package/lib/http.d.ts +46 -0
- package/lib/http.d.ts.map +1 -0
- package/lib/http.js +143 -0
- package/lib/http.js.map +1 -0
- package/lib/retries.d.ts +18 -0
- package/lib/retries.d.ts.map +1 -0
- package/lib/retries.js +157 -0
- package/lib/retries.js.map +1 -0
- package/lib/schemas.d.ts +7 -0
- package/lib/schemas.d.ts.map +1 -0
- package/{shims/web.js → lib/schemas.js} +24 -6
- package/lib/schemas.js.map +1 -0
- package/lib/sdks.d.ts +39 -0
- package/lib/sdks.d.ts.map +1 -0
- package/lib/sdks.js +98 -0
- package/lib/sdks.js.map +1 -0
- package/lib/security.d.ts +57 -0
- package/lib/security.d.ts.map +1 -0
- package/lib/security.js +115 -0
- package/lib/security.js.map +1 -0
- package/lib/url.d.ts +4 -0
- package/lib/url.d.ts.map +1 -0
- package/lib/url.js +26 -0
- package/lib/url.js.map +1 -0
- package/models/components/index.d.ts +5 -0
- package/models/components/index.d.ts.map +1 -0
- package/{_shims/auto/runtime-node.js → models/components/index.js} +8 -5
- package/models/components/index.js.map +1 -0
- package/models/components/linkschema.d.ts +222 -0
- package/models/components/linkschema.d.ts.map +1 -0
- package/models/components/linkschema.js +189 -0
- package/models/components/linkschema.js.map +1 -0
- package/models/components/security.d.ts +16 -0
- package/models/components/security.d.ts.map +1 -0
- package/models/components/security.js +53 -0
- package/models/components/security.js.map +1 -0
- package/models/components/tagschema.d.ts +45 -0
- package/models/components/tagschema.d.ts.map +1 -0
- package/models/components/tagschema.js +76 -0
- package/models/components/tagschema.js.map +1 -0
- package/models/components/workspaceschema.d.ts +178 -0
- package/models/components/workspaceschema.d.ts.map +1 -0
- package/models/components/workspaceschema.js +190 -0
- package/models/components/workspaceschema.js.map +1 -0
- package/models/errors/badrequest.d.ts +65 -0
- package/models/errors/badrequest.d.ts.map +1 -0
- package/models/errors/badrequest.js +111 -0
- package/models/errors/badrequest.js.map +1 -0
- package/models/errors/conflict.d.ts +65 -0
- package/models/errors/conflict.d.ts.map +1 -0
- package/models/errors/conflict.js +111 -0
- package/models/errors/conflict.js.map +1 -0
- package/models/errors/forbidden.d.ts +65 -0
- package/models/errors/forbidden.d.ts.map +1 -0
- package/models/errors/forbidden.js +111 -0
- package/models/errors/forbidden.js.map +1 -0
- package/models/errors/index.d.ts +12 -0
- package/models/errors/index.d.ts.map +1 -0
- package/{_shims/auto/types-node.js → models/errors/index.js} +15 -5
- package/models/errors/index.js.map +1 -0
- package/models/errors/internalservererror.d.ts +65 -0
- package/models/errors/internalservererror.d.ts.map +1 -0
- package/models/errors/internalservererror.js +111 -0
- package/models/errors/internalservererror.js.map +1 -0
- package/models/errors/inviteexpired.d.ts +65 -0
- package/models/errors/inviteexpired.d.ts.map +1 -0
- package/models/errors/inviteexpired.js +111 -0
- package/models/errors/inviteexpired.js.map +1 -0
- package/models/errors/notfound.d.ts +65 -0
- package/models/errors/notfound.d.ts.map +1 -0
- package/models/errors/notfound.js +111 -0
- package/models/errors/notfound.js.map +1 -0
- package/models/errors/ratelimitexceeded.d.ts +65 -0
- package/models/errors/ratelimitexceeded.d.ts.map +1 -0
- package/models/errors/ratelimitexceeded.js +111 -0
- package/models/errors/ratelimitexceeded.js.map +1 -0
- package/models/errors/sdkerror.d.ts +7 -0
- package/models/errors/sdkerror.d.ts.map +1 -0
- package/models/errors/sdkerror.js +19 -0
- package/models/errors/sdkerror.js.map +1 -0
- package/models/errors/sdkvalidationerror.d.ts +17 -0
- package/models/errors/sdkvalidationerror.d.ts.map +1 -0
- package/models/errors/sdkvalidationerror.js +107 -0
- package/models/errors/sdkvalidationerror.js.map +1 -0
- package/models/errors/unauthorized.d.ts +65 -0
- package/models/errors/unauthorized.d.ts.map +1 -0
- package/models/errors/unauthorized.js +111 -0
- package/models/errors/unauthorized.js.map +1 -0
- package/models/errors/unprocessableentity.d.ts +65 -0
- package/models/errors/unprocessableentity.d.ts.map +1 -0
- package/models/errors/unprocessableentity.js +111 -0
- package/models/errors/unprocessableentity.js.map +1 -0
- package/models/operations/bulkcreatelinks.d.ts +146 -0
- package/models/operations/bulkcreatelinks.d.ts.map +1 -0
- package/models/operations/bulkcreatelinks.js +138 -0
- package/models/operations/bulkcreatelinks.js.map +1 -0
- package/models/operations/createlink.d.ts +146 -0
- package/models/operations/createlink.d.ts.map +1 -0
- package/models/operations/createlink.js +141 -0
- package/models/operations/createlink.js.map +1 -0
- package/models/operations/createtag.d.ts +39 -0
- package/models/operations/createtag.d.ts.map +1 -0
- package/models/operations/createtag.js +72 -0
- package/models/operations/createtag.js.map +1 -0
- package/models/operations/createworkspace.d.ts +22 -0
- package/models/operations/createworkspace.d.ts.map +1 -0
- package/models/operations/createworkspace.js +61 -0
- package/models/operations/createworkspace.js.map +1 -0
- package/models/operations/deletelink.d.ts +39 -0
- package/models/operations/deletelink.d.ts.map +1 -0
- package/models/operations/deletelink.js +75 -0
- package/models/operations/deletelink.js.map +1 -0
- package/models/operations/editlink.d.ts +166 -0
- package/models/operations/editlink.d.ts.map +1 -0
- package/models/operations/editlink.js +167 -0
- package/models/operations/editlink.js.map +1 -0
- package/models/operations/getbrowseranalytics.d.ts +378 -0
- package/models/operations/getbrowseranalytics.d.ts.map +1 -0
- package/models/operations/getbrowseranalytics.js +395 -0
- package/models/operations/getbrowseranalytics.js.map +1 -0
- package/models/operations/getcityanalytics.d.ts +641 -0
- package/models/operations/getcityanalytics.d.ts.map +1 -0
- package/models/operations/getcityanalytics.js +657 -0
- package/models/operations/getcityanalytics.js.map +1 -0
- package/models/operations/getclicksanalytics.d.ts +355 -0
- package/models/operations/getclicksanalytics.d.ts.map +1 -0
- package/models/operations/getclicksanalytics.js +369 -0
- package/models/operations/getclicksanalytics.js.map +1 -0
- package/models/operations/getcountryanalytics.d.ts +635 -0
- package/models/operations/getcountryanalytics.d.ts.map +1 -0
- package/models/operations/getcountryanalytics.js +653 -0
- package/models/operations/getcountryanalytics.js.map +1 -0
- package/models/operations/getdeviceanalytics.d.ts +378 -0
- package/models/operations/getdeviceanalytics.d.ts.map +1 -0
- package/models/operations/getdeviceanalytics.js +395 -0
- package/models/operations/getdeviceanalytics.js.map +1 -0
- package/models/operations/getlinkinfo.d.ts +25 -0
- package/models/operations/getlinkinfo.d.ts.map +1 -0
- package/models/operations/getlinkinfo.js +57 -0
- package/models/operations/getlinkinfo.js.map +1 -0
- package/models/operations/getlinks.d.ts +88 -0
- package/models/operations/getlinks.d.ts.map +1 -0
- package/models/operations/getlinks.js +108 -0
- package/models/operations/getlinks.js.map +1 -0
- package/models/operations/getlinkscount.d.ts +93 -0
- package/models/operations/getlinkscount.d.ts.map +1 -0
- package/models/operations/getlinkscount.js +105 -0
- package/models/operations/getlinkscount.js.map +1 -0
- package/models/operations/getosanalytics.d.ts +378 -0
- package/models/operations/getosanalytics.d.ts.map +1 -0
- package/models/operations/getosanalytics.js +395 -0
- package/models/operations/getosanalytics.js.map +1 -0
- package/models/operations/getqrcode.d.ts +60 -0
- package/models/operations/getqrcode.d.ts.map +1 -0
- package/models/operations/getqrcode.js +85 -0
- package/models/operations/getqrcode.js.map +1 -0
- package/models/operations/getrefereranalytics.d.ts +378 -0
- package/models/operations/getrefereranalytics.d.ts.map +1 -0
- package/models/operations/getrefereranalytics.js +395 -0
- package/models/operations/getrefereranalytics.js.map +1 -0
- package/models/operations/gettags.d.ts +10 -0
- package/models/operations/gettags.d.ts.map +1 -0
- package/{shims/node.js → models/operations/gettags.js} +12 -6
- package/models/operations/gettags.js.map +1 -0
- package/models/operations/gettimeseriesanalytics.d.ts +378 -0
- package/models/operations/gettimeseriesanalytics.d.ts.map +1 -0
- package/models/operations/gettimeseriesanalytics.js +395 -0
- package/models/operations/gettimeseriesanalytics.js.map +1 -0
- package/models/operations/gettoplinks.d.ts +378 -0
- package/models/operations/gettoplinks.d.ts.map +1 -0
- package/models/operations/gettoplinks.js +395 -0
- package/models/operations/gettoplinks.js.map +1 -0
- package/models/operations/gettopurls.d.ts +378 -0
- package/models/operations/gettopurls.d.ts.map +1 -0
- package/models/operations/gettopurls.js +395 -0
- package/models/operations/gettopurls.js.map +1 -0
- package/models/operations/getworkspace.d.ts +19 -0
- package/models/operations/getworkspace.d.ts.map +1 -0
- package/models/operations/getworkspace.js +53 -0
- package/models/operations/getworkspace.js.map +1 -0
- package/models/operations/index.d.ts +23 -0
- package/models/operations/index.d.ts.map +1 -0
- package/models/operations/index.js +42 -0
- package/models/operations/index.js.map +1 -0
- package/package.json +25 -98
- package/sdk/analytics.d.ts +78 -0
- package/sdk/analytics.d.ts.map +1 -0
- package/sdk/analytics.js +2044 -0
- package/sdk/analytics.js.map +1 -0
- package/sdk/index.d.ts +2 -0
- package/sdk/index.d.ts.map +1 -0
- package/{_shims/auto/runtime.js → sdk/index.js} +5 -5
- package/sdk/index.js.map +1 -0
- package/sdk/links.d.ts +58 -0
- package/sdk/links.d.ts.map +1 -0
- package/sdk/links.js +1309 -0
- package/sdk/links.js.map +1 -0
- package/sdk/qrcodes.d.ts +21 -0
- package/sdk/qrcodes.d.ts.map +1 -0
- package/sdk/qrcodes.js +249 -0
- package/sdk/qrcodes.js.map +1 -0
- package/sdk/sdk.d.ts +22 -0
- package/sdk/sdk.d.ts.map +1 -0
- package/sdk/sdk.js +59 -0
- package/sdk/sdk.js.map +1 -0
- package/sdk/tags.d.ts +23 -0
- package/sdk/tags.d.ts.map +1 -0
- package/sdk/tags.js +401 -0
- package/sdk/tags.js.map +1 -0
- package/sdk/workspaces.d.ts +30 -0
- package/sdk/workspaces.d.ts.map +1 -0
- package/sdk/workspaces.js +556 -0
- package/sdk/workspaces.js.map +1 -0
- package/src/hooks/hooks.ts +81 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/types.ts +74 -0
- package/src/index.ts +8 -209
- package/src/lib/base64.ts +37 -0
- package/src/lib/config.ts +70 -0
- package/src/lib/encodings.ts +384 -0
- package/src/lib/http.ts +215 -0
- package/src/lib/retries.ts +226 -0
- package/src/lib/schemas.ts +22 -0
- package/src/lib/sdks.ts +139 -0
- package/src/lib/security.ts +180 -0
- package/src/lib/url.ts +31 -0
- package/src/models/components/index.ts +8 -0
- package/src/models/components/linkschema.ts +383 -0
- package/src/models/components/security.ts +40 -0
- package/src/models/components/tagschema.ts +79 -0
- package/src/models/components/workspaceschema.ts +316 -0
- package/src/models/errors/badrequest.ts +140 -0
- package/src/models/errors/conflict.ts +140 -0
- package/src/models/errors/forbidden.ts +140 -0
- package/src/models/errors/index.ts +15 -0
- package/src/models/errors/internalservererror.ts +140 -0
- package/src/models/errors/inviteexpired.ts +140 -0
- package/src/models/errors/notfound.ts +140 -0
- package/src/models/errors/ratelimitexceeded.ts +140 -0
- package/src/models/errors/sdkerror.ts +22 -0
- package/src/models/errors/sdkvalidationerror.ts +95 -0
- package/src/models/errors/unauthorized.ts +140 -0
- package/src/models/errors/unprocessableentity.ts +140 -0
- package/src/models/operations/bulkcreatelinks.ts +254 -0
- package/src/models/operations/createlink.ts +255 -0
- package/src/models/operations/createtag.ts +69 -0
- package/src/models/operations/createworkspace.ts +54 -0
- package/src/models/operations/deletelink.ts +84 -0
- package/src/models/operations/editlink.ts +300 -0
- package/src/models/operations/getbrowseranalytics.ts +484 -0
- package/src/models/operations/getcityanalytics.ts +744 -0
- package/src/models/operations/getclicksanalytics.ts +427 -0
- package/src/models/operations/getcountryanalytics.ts +743 -0
- package/src/models/operations/getdeviceanalytics.ts +480 -0
- package/src/models/operations/getlinkinfo.ts +53 -0
- package/src/models/operations/getlinks.ts +155 -0
- package/src/models/operations/getlinkscount.ts +157 -0
- package/src/models/operations/getosanalytics.ts +475 -0
- package/src/models/operations/getqrcode.ts +106 -0
- package/src/models/operations/getrefereranalytics.ts +484 -0
- package/src/models/operations/gettags.ts +18 -0
- package/src/models/operations/gettimeseriesanalytics.ts +476 -0
- package/src/models/operations/gettoplinks.ts +475 -0
- package/src/models/operations/gettopurls.ts +475 -0
- package/src/models/operations/getworkspace.ts +43 -0
- package/src/models/operations/index.ts +26 -0
- package/src/sdk/analytics.ts +2493 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/links.ts +1617 -0
- package/src/sdk/qrcodes.ts +276 -0
- package/src/sdk/sdk.ts +66 -0
- package/src/sdk/tags.ts +470 -0
- package/src/sdk/workspaces.ts +670 -0
- package/src/types/blobs.ts +30 -0
- package/src/types/index.ts +8 -0
- package/src/types/operations.ts +25 -0
- package/src/types/rfcdate.ts +54 -0
- package/types/blobs.d.ts +4 -0
- package/types/blobs.d.ts.map +1 -0
- package/{resources/projects/projects.js → types/blobs.js} +23 -24
- package/types/blobs.js.map +1 -0
- package/types/index.d.ts +5 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +14 -0
- package/types/index.js.map +1 -0
- package/types/operations.d.ts +13 -0
- package/types/operations.d.ts.map +1 -0
- package/types/operations.js +19 -0
- package/types/operations.js.map +1 -0
- package/types/rfcdate.d.ts +21 -0
- package/types/rfcdate.d.ts.map +1 -0
- package/types/rfcdate.js +46 -0
- package/types/rfcdate.js.map +1 -0
- package/CHANGELOG.md +0 -116
- package/LICENSE +0 -201
- package/_shims/MultipartBody.d.ts +0 -9
- package/_shims/MultipartBody.d.ts.map +0 -1
- package/_shims/MultipartBody.js +0 -16
- package/_shims/MultipartBody.js.map +0 -1
- package/_shims/MultipartBody.mjs +0 -12
- package/_shims/MultipartBody.mjs.map +0 -1
- package/_shims/README.md +0 -46
- package/_shims/auto/runtime-bun.d.ts +0 -5
- package/_shims/auto/runtime-bun.d.ts.map +0 -1
- package/_shims/auto/runtime-bun.js.map +0 -1
- package/_shims/auto/runtime-bun.mjs +0 -2
- package/_shims/auto/runtime-bun.mjs.map +0 -1
- package/_shims/auto/runtime-node.d.ts +0 -5
- package/_shims/auto/runtime-node.d.ts.map +0 -1
- package/_shims/auto/runtime-node.js.map +0 -1
- package/_shims/auto/runtime-node.mjs +0 -2
- package/_shims/auto/runtime-node.mjs.map +0 -1
- package/_shims/auto/runtime.d.ts +0 -5
- package/_shims/auto/runtime.d.ts.map +0 -1
- package/_shims/auto/runtime.js.map +0 -1
- package/_shims/auto/runtime.mjs +0 -2
- package/_shims/auto/runtime.mjs.map +0 -1
- package/_shims/auto/types-node.d.ts +0 -5
- package/_shims/auto/types-node.d.ts.map +0 -1
- package/_shims/auto/types-node.js.map +0 -1
- package/_shims/auto/types-node.mjs +0 -2
- package/_shims/auto/types-node.mjs.map +0 -1
- package/_shims/auto/types.d.ts +0 -101
- package/_shims/auto/types.js +0 -3
- package/_shims/auto/types.mjs +0 -3
- package/_shims/bun-runtime.d.ts +0 -6
- package/_shims/bun-runtime.d.ts.map +0 -1
- package/_shims/bun-runtime.js +0 -14
- package/_shims/bun-runtime.js.map +0 -1
- package/_shims/bun-runtime.mjs +0 -10
- package/_shims/bun-runtime.mjs.map +0 -1
- package/_shims/index.d.ts +0 -81
- package/_shims/index.js +0 -13
- package/_shims/index.mjs +0 -7
- package/_shims/manual-types.d.ts +0 -12
- package/_shims/manual-types.js +0 -3
- package/_shims/manual-types.mjs +0 -3
- package/_shims/node-runtime.d.ts +0 -3
- package/_shims/node-runtime.d.ts.map +0 -1
- package/_shims/node-runtime.js +0 -90
- package/_shims/node-runtime.js.map +0 -1
- package/_shims/node-runtime.mjs +0 -56
- package/_shims/node-runtime.mjs.map +0 -1
- package/_shims/node-types.d.ts +0 -42
- package/_shims/node-types.js +0 -3
- package/_shims/node-types.mjs +0 -3
- package/_shims/registry.d.ts +0 -37
- package/_shims/registry.d.ts.map +0 -1
- package/_shims/registry.js +0 -41
- package/_shims/registry.js.map +0 -1
- package/_shims/registry.mjs +0 -37
- package/_shims/registry.mjs.map +0 -1
- package/_shims/web-runtime.d.ts +0 -5
- package/_shims/web-runtime.d.ts.map +0 -1
- package/_shims/web-runtime.js +0 -78
- package/_shims/web-runtime.js.map +0 -1
- package/_shims/web-runtime.mjs +0 -71
- package/_shims/web-runtime.mjs.map +0 -1
- package/_shims/web-types.d.ts +0 -83
- package/_shims/web-types.js +0 -3
- package/_shims/web-types.mjs +0 -3
- package/core.d.ts +0 -237
- package/core.d.ts.map +0 -1
- package/core.js +0 -868
- package/core.js.map +0 -1
- package/core.mjs +0 -837
- package/core.mjs.map +0 -1
- package/error.d.ts +0 -53
- package/error.d.ts.map +0 -1
- package/error.js +0 -143
- package/error.js.map +0 -1
- package/error.mjs +0 -127
- package/error.mjs.map +0 -1
- package/index.d.mts +0 -127
- package/index.mjs +0 -90
- package/index.mjs.map +0 -1
- package/resource.d.ts +0 -6
- package/resource.d.ts.map +0 -1
- package/resource.js +0 -11
- package/resource.js.map +0 -1
- package/resource.mjs +0 -7
- package/resource.mjs.map +0 -1
- package/resources/index.d.ts +0 -4
- package/resources/index.d.ts.map +0 -1
- package/resources/index.js +0 -11
- package/resources/index.js.map +0 -1
- package/resources/index.mjs +0 -5
- package/resources/index.mjs.map +0 -1
- package/resources/links/bulk.d.ts +0 -274
- package/resources/links/bulk.d.ts.map +0 -1
- package/resources/links/bulk.js +0 -18
- package/resources/links/bulk.js.map +0 -1
- package/resources/links/bulk.mjs +0 -14
- package/resources/links/bulk.mjs.map +0 -1
- package/resources/links/index.d.ts +0 -4
- package/resources/links/index.d.ts.map +0 -1
- package/resources/links/index.js +0 -11
- package/resources/links/index.js.map +0 -1
- package/resources/links/index.mjs +0 -5
- package/resources/links/index.mjs.map +0 -1
- package/resources/links/info.d.ts +0 -186
- package/resources/links/info.d.ts.map +0 -1
- package/resources/links/info.js +0 -18
- package/resources/links/info.js.map +0 -1
- package/resources/links/info.mjs +0 -14
- package/resources/links/info.mjs.map +0 -1
- package/resources/links/links.d.ts +0 -916
- package/resources/links/links.d.ts.map +0 -1
- package/resources/links/links.js +0 -72
- package/resources/links/links.js.map +0 -1
- package/resources/links/links.mjs +0 -45
- package/resources/links/links.mjs.map +0 -1
- package/resources/projects/index.d.ts +0 -3
- package/resources/projects/index.d.ts.map +0 -1
- package/resources/projects/index.js +0 -9
- package/resources/projects/index.js.map +0 -1
- package/resources/projects/index.mjs +0 -4
- package/resources/projects/index.mjs.map +0 -1
- package/resources/projects/projects.d.ts +0 -200
- package/resources/projects/projects.d.ts.map +0 -1
- package/resources/projects/projects.js.map +0 -1
- package/resources/projects/projects.mjs +0 -26
- package/resources/projects/projects.mjs.map +0 -1
- package/resources/projects/tags.d.ts +0 -4
- package/resources/projects/tags.d.ts.map +0 -1
- package/resources/projects/tags.js +0 -9
- package/resources/projects/tags.js.map +0 -1
- package/resources/projects/tags.mjs +0 -5
- package/resources/projects/tags.mjs.map +0 -1
- package/resources/qr.d.ts +0 -45
- package/resources/qr.d.ts.map +0 -1
- package/resources/qr.js +0 -18
- package/resources/qr.js.map +0 -1
- package/resources/qr.mjs +0 -14
- package/resources/qr.mjs.map +0 -1
- package/shims/node.d.ts +0 -29
- package/shims/node.d.ts.map +0 -1
- package/shims/node.js.map +0 -1
- package/shims/node.mjs +0 -5
- package/shims/node.mjs.map +0 -1
- package/shims/web.d.ts +0 -26
- package/shims/web.d.ts.map +0 -1
- package/shims/web.js.map +0 -1
- package/shims/web.mjs +0 -5
- package/shims/web.mjs.map +0 -1
- package/src/_shims/MultipartBody.ts +0 -9
- package/src/_shims/README.md +0 -46
- package/src/_shims/auto/runtime-bun.ts +0 -4
- package/src/_shims/auto/runtime-node.ts +0 -4
- package/src/_shims/auto/runtime.ts +0 -4
- package/src/_shims/auto/types-node.ts +0 -4
- package/src/_shims/auto/types.d.ts +0 -101
- package/src/_shims/auto/types.js +0 -3
- package/src/_shims/auto/types.mjs +0 -3
- package/src/_shims/bun-runtime.ts +0 -14
- package/src/_shims/index.d.ts +0 -81
- package/src/_shims/index.js +0 -13
- package/src/_shims/index.mjs +0 -7
- package/src/_shims/manual-types.d.ts +0 -12
- package/src/_shims/manual-types.js +0 -3
- package/src/_shims/manual-types.mjs +0 -3
- package/src/_shims/node-runtime.ts +0 -83
- package/src/_shims/node-types.d.ts +0 -42
- package/src/_shims/node-types.js +0 -3
- package/src/_shims/node-types.mjs +0 -3
- package/src/_shims/registry.ts +0 -63
- package/src/_shims/web-runtime.ts +0 -103
- package/src/_shims/web-types.d.ts +0 -83
- package/src/_shims/web-types.js +0 -3
- package/src/_shims/web-types.mjs +0 -3
- package/src/core.ts +0 -1145
- package/src/error.ts +0 -146
- package/src/lib/.keep +0 -4
- package/src/resource.ts +0 -11
- package/src/resources/index.ts +0 -20
- package/src/resources/links/bulk.ts +0 -337
- package/src/resources/links/index.ts +0 -15
- package/src/resources/links/info.ts +0 -230
- package/src/resources/links/links.ts +0 -1135
- package/src/resources/projects/index.ts +0 -4
- package/src/resources/projects/projects.ts +0 -253
- package/src/resources/projects/tags.ts +0 -5
- package/src/resources/qr.ts +0 -64
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
- package/src/tsconfig.json +0 -11
- package/src/uploads.ts +0 -245
- package/src/version.ts +0 -1
- package/uploads.d.ts +0 -75
- package/uploads.d.ts.map +0 -1
- package/uploads.js +0 -163
- package/uploads.js.map +0 -1
- package/uploads.mjs +0 -150
- package/uploads.mjs.map +0 -1
- package/version.d.ts +0 -2
- package/version.d.ts.map +0 -1
- package/version.js +0 -5
- package/version.js.map +0 -1
- package/version.mjs +0 -2
- package/version.mjs.map +0 -1
package/src/sdk/links.ts
ADDED
|
@@ -0,0 +1,1617 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKHooks } from "../hooks";
|
|
6
|
+
import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config";
|
|
7
|
+
import * as enc$ from "../lib/encodings";
|
|
8
|
+
import { HTTPClient } from "../lib/http";
|
|
9
|
+
import * as schemas$ from "../lib/schemas";
|
|
10
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks";
|
|
11
|
+
import * as components from "../models/components";
|
|
12
|
+
import * as errors from "../models/errors";
|
|
13
|
+
import * as operations from "../models/operations";
|
|
14
|
+
import * as z from "zod";
|
|
15
|
+
|
|
16
|
+
export class Links extends ClientSDK {
|
|
17
|
+
private readonly options$: SDKOptions & { hooks?: SDKHooks };
|
|
18
|
+
|
|
19
|
+
constructor(options: SDKOptions = {}) {
|
|
20
|
+
const opt = options as unknown;
|
|
21
|
+
let hooks: SDKHooks;
|
|
22
|
+
if (
|
|
23
|
+
typeof opt === "object" &&
|
|
24
|
+
opt != null &&
|
|
25
|
+
"hooks" in opt &&
|
|
26
|
+
opt.hooks instanceof SDKHooks
|
|
27
|
+
) {
|
|
28
|
+
hooks = opt.hooks;
|
|
29
|
+
} else {
|
|
30
|
+
hooks = new SDKHooks();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
super({
|
|
34
|
+
client: options.httpClient || new HTTPClient(),
|
|
35
|
+
baseURL: serverURLFromOptions(options),
|
|
36
|
+
hooks,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
this.options$ = { ...options, hooks };
|
|
40
|
+
void this.options$;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve a list of links
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* Retrieve a list of links for the authenticated workspace. The list will be paginated and the provided query parameters allow filtering the returned links.
|
|
48
|
+
*/
|
|
49
|
+
async list(
|
|
50
|
+
input: operations.GetLinksRequest,
|
|
51
|
+
options?: RequestOptions
|
|
52
|
+
): Promise<Array<components.LinkSchema>> {
|
|
53
|
+
const headers$ = new Headers();
|
|
54
|
+
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
55
|
+
headers$.set("Accept", "application/json");
|
|
56
|
+
|
|
57
|
+
const payload$ = schemas$.parse(
|
|
58
|
+
input,
|
|
59
|
+
(value$) => operations.GetLinksRequest$.outboundSchema.parse(value$),
|
|
60
|
+
"Input validation failed"
|
|
61
|
+
);
|
|
62
|
+
const body$ = null;
|
|
63
|
+
|
|
64
|
+
const path$ = this.templateURLComponent("/links")();
|
|
65
|
+
|
|
66
|
+
const query$ = [
|
|
67
|
+
enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }),
|
|
68
|
+
enc$.encodeForm("page", payload$.page, { explode: true, charEncoding: "percent" }),
|
|
69
|
+
enc$.encodeForm("search", payload$.search, { explode: true, charEncoding: "percent" }),
|
|
70
|
+
enc$.encodeForm("showArchived", payload$.showArchived, {
|
|
71
|
+
explode: true,
|
|
72
|
+
charEncoding: "percent",
|
|
73
|
+
}),
|
|
74
|
+
enc$.encodeForm("sort", payload$.sort, { explode: true, charEncoding: "percent" }),
|
|
75
|
+
enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }),
|
|
76
|
+
enc$.encodeForm("tagIds", payload$.tagIds, { explode: true, charEncoding: "percent" }),
|
|
77
|
+
enc$.encodeForm("userId", payload$.userId, { explode: true, charEncoding: "percent" }),
|
|
78
|
+
enc$.encodeForm("withTags", payload$.withTags, {
|
|
79
|
+
explode: true,
|
|
80
|
+
charEncoding: "percent",
|
|
81
|
+
}),
|
|
82
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
83
|
+
explode: true,
|
|
84
|
+
charEncoding: "percent",
|
|
85
|
+
}),
|
|
86
|
+
]
|
|
87
|
+
.filter(Boolean)
|
|
88
|
+
.join("&");
|
|
89
|
+
|
|
90
|
+
let security$;
|
|
91
|
+
if (typeof this.options$.token === "function") {
|
|
92
|
+
security$ = { token: await this.options$.token() };
|
|
93
|
+
} else if (this.options$.token) {
|
|
94
|
+
security$ = { token: this.options$.token };
|
|
95
|
+
} else {
|
|
96
|
+
security$ = {};
|
|
97
|
+
}
|
|
98
|
+
const context = {
|
|
99
|
+
operationID: "getLinks",
|
|
100
|
+
oAuth2Scopes: [],
|
|
101
|
+
securitySource: this.options$.token,
|
|
102
|
+
};
|
|
103
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
104
|
+
|
|
105
|
+
const doOptions = {
|
|
106
|
+
context,
|
|
107
|
+
errorCodes: [
|
|
108
|
+
"400",
|
|
109
|
+
"401",
|
|
110
|
+
"403",
|
|
111
|
+
"404",
|
|
112
|
+
"409",
|
|
113
|
+
"410",
|
|
114
|
+
"422",
|
|
115
|
+
"429",
|
|
116
|
+
"4XX",
|
|
117
|
+
"500",
|
|
118
|
+
"5XX",
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
const request = this.createRequest$(
|
|
122
|
+
{
|
|
123
|
+
security: securitySettings$,
|
|
124
|
+
method: "GET",
|
|
125
|
+
path: path$,
|
|
126
|
+
headers: headers$,
|
|
127
|
+
query: query$,
|
|
128
|
+
body: body$,
|
|
129
|
+
},
|
|
130
|
+
options
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
const response = await this.do$(request, doOptions);
|
|
134
|
+
|
|
135
|
+
const responseFields$ = {
|
|
136
|
+
HttpMeta: {
|
|
137
|
+
Response: response,
|
|
138
|
+
Request: request,
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
143
|
+
const responseBody = await response.json();
|
|
144
|
+
const result = schemas$.parse(
|
|
145
|
+
responseBody,
|
|
146
|
+
(val$) => {
|
|
147
|
+
return z.array(components.LinkSchema$.inboundSchema).parse(val$);
|
|
148
|
+
},
|
|
149
|
+
"Response validation failed"
|
|
150
|
+
);
|
|
151
|
+
return result;
|
|
152
|
+
} else if (this.matchResponse(response, 400, "application/json")) {
|
|
153
|
+
const responseBody = await response.json();
|
|
154
|
+
const result = schemas$.parse(
|
|
155
|
+
responseBody,
|
|
156
|
+
(val$) => {
|
|
157
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
158
|
+
...responseFields$,
|
|
159
|
+
...val$,
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
"Response validation failed"
|
|
163
|
+
);
|
|
164
|
+
throw result;
|
|
165
|
+
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
166
|
+
const responseBody = await response.json();
|
|
167
|
+
const result = schemas$.parse(
|
|
168
|
+
responseBody,
|
|
169
|
+
(val$) => {
|
|
170
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
171
|
+
...responseFields$,
|
|
172
|
+
...val$,
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
"Response validation failed"
|
|
176
|
+
);
|
|
177
|
+
throw result;
|
|
178
|
+
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
179
|
+
const responseBody = await response.json();
|
|
180
|
+
const result = schemas$.parse(
|
|
181
|
+
responseBody,
|
|
182
|
+
(val$) => {
|
|
183
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
184
|
+
...responseFields$,
|
|
185
|
+
...val$,
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
"Response validation failed"
|
|
189
|
+
);
|
|
190
|
+
throw result;
|
|
191
|
+
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
192
|
+
const responseBody = await response.json();
|
|
193
|
+
const result = schemas$.parse(
|
|
194
|
+
responseBody,
|
|
195
|
+
(val$) => {
|
|
196
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
197
|
+
...responseFields$,
|
|
198
|
+
...val$,
|
|
199
|
+
});
|
|
200
|
+
},
|
|
201
|
+
"Response validation failed"
|
|
202
|
+
);
|
|
203
|
+
throw result;
|
|
204
|
+
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
205
|
+
const responseBody = await response.json();
|
|
206
|
+
const result = schemas$.parse(
|
|
207
|
+
responseBody,
|
|
208
|
+
(val$) => {
|
|
209
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
210
|
+
...responseFields$,
|
|
211
|
+
...val$,
|
|
212
|
+
});
|
|
213
|
+
},
|
|
214
|
+
"Response validation failed"
|
|
215
|
+
);
|
|
216
|
+
throw result;
|
|
217
|
+
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
218
|
+
const responseBody = await response.json();
|
|
219
|
+
const result = schemas$.parse(
|
|
220
|
+
responseBody,
|
|
221
|
+
(val$) => {
|
|
222
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
223
|
+
...responseFields$,
|
|
224
|
+
...val$,
|
|
225
|
+
});
|
|
226
|
+
},
|
|
227
|
+
"Response validation failed"
|
|
228
|
+
);
|
|
229
|
+
throw result;
|
|
230
|
+
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
231
|
+
const responseBody = await response.json();
|
|
232
|
+
const result = schemas$.parse(
|
|
233
|
+
responseBody,
|
|
234
|
+
(val$) => {
|
|
235
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
236
|
+
...responseFields$,
|
|
237
|
+
...val$,
|
|
238
|
+
});
|
|
239
|
+
},
|
|
240
|
+
"Response validation failed"
|
|
241
|
+
);
|
|
242
|
+
throw result;
|
|
243
|
+
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
244
|
+
const responseBody = await response.json();
|
|
245
|
+
const result = schemas$.parse(
|
|
246
|
+
responseBody,
|
|
247
|
+
(val$) => {
|
|
248
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
249
|
+
...responseFields$,
|
|
250
|
+
...val$,
|
|
251
|
+
});
|
|
252
|
+
},
|
|
253
|
+
"Response validation failed"
|
|
254
|
+
);
|
|
255
|
+
throw result;
|
|
256
|
+
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
257
|
+
const responseBody = await response.json();
|
|
258
|
+
const result = schemas$.parse(
|
|
259
|
+
responseBody,
|
|
260
|
+
(val$) => {
|
|
261
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
262
|
+
...responseFields$,
|
|
263
|
+
...val$,
|
|
264
|
+
});
|
|
265
|
+
},
|
|
266
|
+
"Response validation failed"
|
|
267
|
+
);
|
|
268
|
+
throw result;
|
|
269
|
+
} else {
|
|
270
|
+
const responseBody = await response.text();
|
|
271
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Create a new link
|
|
277
|
+
*
|
|
278
|
+
* @remarks
|
|
279
|
+
* Create a new link for the authenticated workspace.
|
|
280
|
+
*/
|
|
281
|
+
async create(
|
|
282
|
+
input: operations.CreateLinkRequestBody | undefined,
|
|
283
|
+
options?: RequestOptions
|
|
284
|
+
): Promise<components.LinkSchema> {
|
|
285
|
+
const headers$ = new Headers();
|
|
286
|
+
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
287
|
+
headers$.set("Content-Type", "application/json");
|
|
288
|
+
headers$.set("Accept", "application/json");
|
|
289
|
+
|
|
290
|
+
const payload$ = schemas$.parse(
|
|
291
|
+
input,
|
|
292
|
+
(value$) => operations.CreateLinkRequestBody$.outboundSchema.optional().parse(value$),
|
|
293
|
+
"Input validation failed"
|
|
294
|
+
);
|
|
295
|
+
const body$ =
|
|
296
|
+
payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true });
|
|
297
|
+
|
|
298
|
+
const path$ = this.templateURLComponent("/links")();
|
|
299
|
+
|
|
300
|
+
const query$ = [
|
|
301
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
302
|
+
explode: true,
|
|
303
|
+
charEncoding: "percent",
|
|
304
|
+
}),
|
|
305
|
+
]
|
|
306
|
+
.filter(Boolean)
|
|
307
|
+
.join("&");
|
|
308
|
+
|
|
309
|
+
let security$;
|
|
310
|
+
if (typeof this.options$.token === "function") {
|
|
311
|
+
security$ = { token: await this.options$.token() };
|
|
312
|
+
} else if (this.options$.token) {
|
|
313
|
+
security$ = { token: this.options$.token };
|
|
314
|
+
} else {
|
|
315
|
+
security$ = {};
|
|
316
|
+
}
|
|
317
|
+
const context = {
|
|
318
|
+
operationID: "createLink",
|
|
319
|
+
oAuth2Scopes: [],
|
|
320
|
+
securitySource: this.options$.token,
|
|
321
|
+
};
|
|
322
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
323
|
+
|
|
324
|
+
const doOptions = {
|
|
325
|
+
context,
|
|
326
|
+
errorCodes: [
|
|
327
|
+
"400",
|
|
328
|
+
"401",
|
|
329
|
+
"403",
|
|
330
|
+
"404",
|
|
331
|
+
"409",
|
|
332
|
+
"410",
|
|
333
|
+
"422",
|
|
334
|
+
"429",
|
|
335
|
+
"4XX",
|
|
336
|
+
"500",
|
|
337
|
+
"5XX",
|
|
338
|
+
],
|
|
339
|
+
};
|
|
340
|
+
const request = this.createRequest$(
|
|
341
|
+
{
|
|
342
|
+
security: securitySettings$,
|
|
343
|
+
method: "POST",
|
|
344
|
+
path: path$,
|
|
345
|
+
headers: headers$,
|
|
346
|
+
query: query$,
|
|
347
|
+
body: body$,
|
|
348
|
+
},
|
|
349
|
+
options
|
|
350
|
+
);
|
|
351
|
+
|
|
352
|
+
const response = await this.do$(request, doOptions);
|
|
353
|
+
|
|
354
|
+
const responseFields$ = {
|
|
355
|
+
HttpMeta: {
|
|
356
|
+
Response: response,
|
|
357
|
+
Request: request,
|
|
358
|
+
},
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
362
|
+
const responseBody = await response.json();
|
|
363
|
+
const result = schemas$.parse(
|
|
364
|
+
responseBody,
|
|
365
|
+
(val$) => {
|
|
366
|
+
return components.LinkSchema$.inboundSchema.parse(val$);
|
|
367
|
+
},
|
|
368
|
+
"Response validation failed"
|
|
369
|
+
);
|
|
370
|
+
return result;
|
|
371
|
+
} else if (this.matchResponse(response, 400, "application/json")) {
|
|
372
|
+
const responseBody = await response.json();
|
|
373
|
+
const result = schemas$.parse(
|
|
374
|
+
responseBody,
|
|
375
|
+
(val$) => {
|
|
376
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
377
|
+
...responseFields$,
|
|
378
|
+
...val$,
|
|
379
|
+
});
|
|
380
|
+
},
|
|
381
|
+
"Response validation failed"
|
|
382
|
+
);
|
|
383
|
+
throw result;
|
|
384
|
+
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
385
|
+
const responseBody = await response.json();
|
|
386
|
+
const result = schemas$.parse(
|
|
387
|
+
responseBody,
|
|
388
|
+
(val$) => {
|
|
389
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
390
|
+
...responseFields$,
|
|
391
|
+
...val$,
|
|
392
|
+
});
|
|
393
|
+
},
|
|
394
|
+
"Response validation failed"
|
|
395
|
+
);
|
|
396
|
+
throw result;
|
|
397
|
+
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
398
|
+
const responseBody = await response.json();
|
|
399
|
+
const result = schemas$.parse(
|
|
400
|
+
responseBody,
|
|
401
|
+
(val$) => {
|
|
402
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
403
|
+
...responseFields$,
|
|
404
|
+
...val$,
|
|
405
|
+
});
|
|
406
|
+
},
|
|
407
|
+
"Response validation failed"
|
|
408
|
+
);
|
|
409
|
+
throw result;
|
|
410
|
+
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
411
|
+
const responseBody = await response.json();
|
|
412
|
+
const result = schemas$.parse(
|
|
413
|
+
responseBody,
|
|
414
|
+
(val$) => {
|
|
415
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
416
|
+
...responseFields$,
|
|
417
|
+
...val$,
|
|
418
|
+
});
|
|
419
|
+
},
|
|
420
|
+
"Response validation failed"
|
|
421
|
+
);
|
|
422
|
+
throw result;
|
|
423
|
+
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
424
|
+
const responseBody = await response.json();
|
|
425
|
+
const result = schemas$.parse(
|
|
426
|
+
responseBody,
|
|
427
|
+
(val$) => {
|
|
428
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
429
|
+
...responseFields$,
|
|
430
|
+
...val$,
|
|
431
|
+
});
|
|
432
|
+
},
|
|
433
|
+
"Response validation failed"
|
|
434
|
+
);
|
|
435
|
+
throw result;
|
|
436
|
+
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
437
|
+
const responseBody = await response.json();
|
|
438
|
+
const result = schemas$.parse(
|
|
439
|
+
responseBody,
|
|
440
|
+
(val$) => {
|
|
441
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
442
|
+
...responseFields$,
|
|
443
|
+
...val$,
|
|
444
|
+
});
|
|
445
|
+
},
|
|
446
|
+
"Response validation failed"
|
|
447
|
+
);
|
|
448
|
+
throw result;
|
|
449
|
+
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
450
|
+
const responseBody = await response.json();
|
|
451
|
+
const result = schemas$.parse(
|
|
452
|
+
responseBody,
|
|
453
|
+
(val$) => {
|
|
454
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
455
|
+
...responseFields$,
|
|
456
|
+
...val$,
|
|
457
|
+
});
|
|
458
|
+
},
|
|
459
|
+
"Response validation failed"
|
|
460
|
+
);
|
|
461
|
+
throw result;
|
|
462
|
+
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
463
|
+
const responseBody = await response.json();
|
|
464
|
+
const result = schemas$.parse(
|
|
465
|
+
responseBody,
|
|
466
|
+
(val$) => {
|
|
467
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
468
|
+
...responseFields$,
|
|
469
|
+
...val$,
|
|
470
|
+
});
|
|
471
|
+
},
|
|
472
|
+
"Response validation failed"
|
|
473
|
+
);
|
|
474
|
+
throw result;
|
|
475
|
+
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
476
|
+
const responseBody = await response.json();
|
|
477
|
+
const result = schemas$.parse(
|
|
478
|
+
responseBody,
|
|
479
|
+
(val$) => {
|
|
480
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
481
|
+
...responseFields$,
|
|
482
|
+
...val$,
|
|
483
|
+
});
|
|
484
|
+
},
|
|
485
|
+
"Response validation failed"
|
|
486
|
+
);
|
|
487
|
+
throw result;
|
|
488
|
+
} else {
|
|
489
|
+
const responseBody = await response.text();
|
|
490
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Retrieve the number of links
|
|
496
|
+
*
|
|
497
|
+
* @remarks
|
|
498
|
+
* Retrieve the number of links for the authenticated workspace. The provided query parameters allow filtering the returned links.
|
|
499
|
+
*/
|
|
500
|
+
async count(input: operations.GetLinksCountRequest, options?: RequestOptions): Promise<number> {
|
|
501
|
+
const headers$ = new Headers();
|
|
502
|
+
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
503
|
+
headers$.set("Accept", "application/json");
|
|
504
|
+
|
|
505
|
+
const payload$ = schemas$.parse(
|
|
506
|
+
input,
|
|
507
|
+
(value$) => operations.GetLinksCountRequest$.outboundSchema.parse(value$),
|
|
508
|
+
"Input validation failed"
|
|
509
|
+
);
|
|
510
|
+
const body$ = null;
|
|
511
|
+
|
|
512
|
+
const path$ = this.templateURLComponent("/links/count")();
|
|
513
|
+
|
|
514
|
+
const query$ = [
|
|
515
|
+
enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }),
|
|
516
|
+
enc$.encodeForm("groupBy", payload$.groupBy, {
|
|
517
|
+
explode: true,
|
|
518
|
+
charEncoding: "percent",
|
|
519
|
+
}),
|
|
520
|
+
enc$.encodeForm("search", payload$.search, { explode: true, charEncoding: "percent" }),
|
|
521
|
+
enc$.encodeForm("showArchived", payload$.showArchived, {
|
|
522
|
+
explode: true,
|
|
523
|
+
charEncoding: "percent",
|
|
524
|
+
}),
|
|
525
|
+
enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }),
|
|
526
|
+
enc$.encodeForm("tagIds", payload$.tagIds, { explode: true, charEncoding: "percent" }),
|
|
527
|
+
enc$.encodeForm("userId", payload$.userId, { explode: true, charEncoding: "percent" }),
|
|
528
|
+
enc$.encodeForm("withTags", payload$.withTags, {
|
|
529
|
+
explode: true,
|
|
530
|
+
charEncoding: "percent",
|
|
531
|
+
}),
|
|
532
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
533
|
+
explode: true,
|
|
534
|
+
charEncoding: "percent",
|
|
535
|
+
}),
|
|
536
|
+
]
|
|
537
|
+
.filter(Boolean)
|
|
538
|
+
.join("&");
|
|
539
|
+
|
|
540
|
+
let security$;
|
|
541
|
+
if (typeof this.options$.token === "function") {
|
|
542
|
+
security$ = { token: await this.options$.token() };
|
|
543
|
+
} else if (this.options$.token) {
|
|
544
|
+
security$ = { token: this.options$.token };
|
|
545
|
+
} else {
|
|
546
|
+
security$ = {};
|
|
547
|
+
}
|
|
548
|
+
const context = {
|
|
549
|
+
operationID: "getLinksCount",
|
|
550
|
+
oAuth2Scopes: [],
|
|
551
|
+
securitySource: this.options$.token,
|
|
552
|
+
};
|
|
553
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
554
|
+
|
|
555
|
+
const doOptions = {
|
|
556
|
+
context,
|
|
557
|
+
errorCodes: [
|
|
558
|
+
"400",
|
|
559
|
+
"401",
|
|
560
|
+
"403",
|
|
561
|
+
"404",
|
|
562
|
+
"409",
|
|
563
|
+
"410",
|
|
564
|
+
"422",
|
|
565
|
+
"429",
|
|
566
|
+
"4XX",
|
|
567
|
+
"500",
|
|
568
|
+
"5XX",
|
|
569
|
+
],
|
|
570
|
+
};
|
|
571
|
+
const request = this.createRequest$(
|
|
572
|
+
{
|
|
573
|
+
security: securitySettings$,
|
|
574
|
+
method: "GET",
|
|
575
|
+
path: path$,
|
|
576
|
+
headers: headers$,
|
|
577
|
+
query: query$,
|
|
578
|
+
body: body$,
|
|
579
|
+
},
|
|
580
|
+
options
|
|
581
|
+
);
|
|
582
|
+
|
|
583
|
+
const response = await this.do$(request, doOptions);
|
|
584
|
+
|
|
585
|
+
const responseFields$ = {
|
|
586
|
+
HttpMeta: {
|
|
587
|
+
Response: response,
|
|
588
|
+
Request: request,
|
|
589
|
+
},
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
593
|
+
const responseBody = await response.json();
|
|
594
|
+
const result = schemas$.parse(
|
|
595
|
+
responseBody,
|
|
596
|
+
(val$) => {
|
|
597
|
+
return z.number().parse(val$);
|
|
598
|
+
},
|
|
599
|
+
"Response validation failed"
|
|
600
|
+
);
|
|
601
|
+
return result;
|
|
602
|
+
} else if (this.matchResponse(response, 400, "application/json")) {
|
|
603
|
+
const responseBody = await response.json();
|
|
604
|
+
const result = schemas$.parse(
|
|
605
|
+
responseBody,
|
|
606
|
+
(val$) => {
|
|
607
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
608
|
+
...responseFields$,
|
|
609
|
+
...val$,
|
|
610
|
+
});
|
|
611
|
+
},
|
|
612
|
+
"Response validation failed"
|
|
613
|
+
);
|
|
614
|
+
throw result;
|
|
615
|
+
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
616
|
+
const responseBody = await response.json();
|
|
617
|
+
const result = schemas$.parse(
|
|
618
|
+
responseBody,
|
|
619
|
+
(val$) => {
|
|
620
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
621
|
+
...responseFields$,
|
|
622
|
+
...val$,
|
|
623
|
+
});
|
|
624
|
+
},
|
|
625
|
+
"Response validation failed"
|
|
626
|
+
);
|
|
627
|
+
throw result;
|
|
628
|
+
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
629
|
+
const responseBody = await response.json();
|
|
630
|
+
const result = schemas$.parse(
|
|
631
|
+
responseBody,
|
|
632
|
+
(val$) => {
|
|
633
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
634
|
+
...responseFields$,
|
|
635
|
+
...val$,
|
|
636
|
+
});
|
|
637
|
+
},
|
|
638
|
+
"Response validation failed"
|
|
639
|
+
);
|
|
640
|
+
throw result;
|
|
641
|
+
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
642
|
+
const responseBody = await response.json();
|
|
643
|
+
const result = schemas$.parse(
|
|
644
|
+
responseBody,
|
|
645
|
+
(val$) => {
|
|
646
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
647
|
+
...responseFields$,
|
|
648
|
+
...val$,
|
|
649
|
+
});
|
|
650
|
+
},
|
|
651
|
+
"Response validation failed"
|
|
652
|
+
);
|
|
653
|
+
throw result;
|
|
654
|
+
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
655
|
+
const responseBody = await response.json();
|
|
656
|
+
const result = schemas$.parse(
|
|
657
|
+
responseBody,
|
|
658
|
+
(val$) => {
|
|
659
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
660
|
+
...responseFields$,
|
|
661
|
+
...val$,
|
|
662
|
+
});
|
|
663
|
+
},
|
|
664
|
+
"Response validation failed"
|
|
665
|
+
);
|
|
666
|
+
throw result;
|
|
667
|
+
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
668
|
+
const responseBody = await response.json();
|
|
669
|
+
const result = schemas$.parse(
|
|
670
|
+
responseBody,
|
|
671
|
+
(val$) => {
|
|
672
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
673
|
+
...responseFields$,
|
|
674
|
+
...val$,
|
|
675
|
+
});
|
|
676
|
+
},
|
|
677
|
+
"Response validation failed"
|
|
678
|
+
);
|
|
679
|
+
throw result;
|
|
680
|
+
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
681
|
+
const responseBody = await response.json();
|
|
682
|
+
const result = schemas$.parse(
|
|
683
|
+
responseBody,
|
|
684
|
+
(val$) => {
|
|
685
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
686
|
+
...responseFields$,
|
|
687
|
+
...val$,
|
|
688
|
+
});
|
|
689
|
+
},
|
|
690
|
+
"Response validation failed"
|
|
691
|
+
);
|
|
692
|
+
throw result;
|
|
693
|
+
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
694
|
+
const responseBody = await response.json();
|
|
695
|
+
const result = schemas$.parse(
|
|
696
|
+
responseBody,
|
|
697
|
+
(val$) => {
|
|
698
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
699
|
+
...responseFields$,
|
|
700
|
+
...val$,
|
|
701
|
+
});
|
|
702
|
+
},
|
|
703
|
+
"Response validation failed"
|
|
704
|
+
);
|
|
705
|
+
throw result;
|
|
706
|
+
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
707
|
+
const responseBody = await response.json();
|
|
708
|
+
const result = schemas$.parse(
|
|
709
|
+
responseBody,
|
|
710
|
+
(val$) => {
|
|
711
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
712
|
+
...responseFields$,
|
|
713
|
+
...val$,
|
|
714
|
+
});
|
|
715
|
+
},
|
|
716
|
+
"Response validation failed"
|
|
717
|
+
);
|
|
718
|
+
throw result;
|
|
719
|
+
} else {
|
|
720
|
+
const responseBody = await response.text();
|
|
721
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* Retrieve a link
|
|
727
|
+
*
|
|
728
|
+
* @remarks
|
|
729
|
+
* Retrieve the info for a link from their domain and key.
|
|
730
|
+
*/
|
|
731
|
+
async get(
|
|
732
|
+
input: operations.GetLinkInfoRequest,
|
|
733
|
+
options?: RequestOptions
|
|
734
|
+
): Promise<components.LinkSchema> {
|
|
735
|
+
const headers$ = new Headers();
|
|
736
|
+
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
737
|
+
headers$.set("Accept", "application/json");
|
|
738
|
+
|
|
739
|
+
const payload$ = schemas$.parse(
|
|
740
|
+
input,
|
|
741
|
+
(value$) => operations.GetLinkInfoRequest$.outboundSchema.parse(value$),
|
|
742
|
+
"Input validation failed"
|
|
743
|
+
);
|
|
744
|
+
const body$ = null;
|
|
745
|
+
|
|
746
|
+
const path$ = this.templateURLComponent("/links/info")();
|
|
747
|
+
|
|
748
|
+
const query$ = [
|
|
749
|
+
enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }),
|
|
750
|
+
enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }),
|
|
751
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
752
|
+
explode: true,
|
|
753
|
+
charEncoding: "percent",
|
|
754
|
+
}),
|
|
755
|
+
]
|
|
756
|
+
.filter(Boolean)
|
|
757
|
+
.join("&");
|
|
758
|
+
|
|
759
|
+
let security$;
|
|
760
|
+
if (typeof this.options$.token === "function") {
|
|
761
|
+
security$ = { token: await this.options$.token() };
|
|
762
|
+
} else if (this.options$.token) {
|
|
763
|
+
security$ = { token: this.options$.token };
|
|
764
|
+
} else {
|
|
765
|
+
security$ = {};
|
|
766
|
+
}
|
|
767
|
+
const context = {
|
|
768
|
+
operationID: "getLinkInfo",
|
|
769
|
+
oAuth2Scopes: [],
|
|
770
|
+
securitySource: this.options$.token,
|
|
771
|
+
};
|
|
772
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
773
|
+
|
|
774
|
+
const doOptions = {
|
|
775
|
+
context,
|
|
776
|
+
errorCodes: [
|
|
777
|
+
"400",
|
|
778
|
+
"401",
|
|
779
|
+
"403",
|
|
780
|
+
"404",
|
|
781
|
+
"409",
|
|
782
|
+
"410",
|
|
783
|
+
"422",
|
|
784
|
+
"429",
|
|
785
|
+
"4XX",
|
|
786
|
+
"500",
|
|
787
|
+
"5XX",
|
|
788
|
+
],
|
|
789
|
+
};
|
|
790
|
+
const request = this.createRequest$(
|
|
791
|
+
{
|
|
792
|
+
security: securitySettings$,
|
|
793
|
+
method: "GET",
|
|
794
|
+
path: path$,
|
|
795
|
+
headers: headers$,
|
|
796
|
+
query: query$,
|
|
797
|
+
body: body$,
|
|
798
|
+
},
|
|
799
|
+
options
|
|
800
|
+
);
|
|
801
|
+
|
|
802
|
+
const response = await this.do$(request, doOptions);
|
|
803
|
+
|
|
804
|
+
const responseFields$ = {
|
|
805
|
+
HttpMeta: {
|
|
806
|
+
Response: response,
|
|
807
|
+
Request: request,
|
|
808
|
+
},
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
812
|
+
const responseBody = await response.json();
|
|
813
|
+
const result = schemas$.parse(
|
|
814
|
+
responseBody,
|
|
815
|
+
(val$) => {
|
|
816
|
+
return components.LinkSchema$.inboundSchema.parse(val$);
|
|
817
|
+
},
|
|
818
|
+
"Response validation failed"
|
|
819
|
+
);
|
|
820
|
+
return result;
|
|
821
|
+
} else if (this.matchResponse(response, 400, "application/json")) {
|
|
822
|
+
const responseBody = await response.json();
|
|
823
|
+
const result = schemas$.parse(
|
|
824
|
+
responseBody,
|
|
825
|
+
(val$) => {
|
|
826
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
827
|
+
...responseFields$,
|
|
828
|
+
...val$,
|
|
829
|
+
});
|
|
830
|
+
},
|
|
831
|
+
"Response validation failed"
|
|
832
|
+
);
|
|
833
|
+
throw result;
|
|
834
|
+
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
835
|
+
const responseBody = await response.json();
|
|
836
|
+
const result = schemas$.parse(
|
|
837
|
+
responseBody,
|
|
838
|
+
(val$) => {
|
|
839
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
840
|
+
...responseFields$,
|
|
841
|
+
...val$,
|
|
842
|
+
});
|
|
843
|
+
},
|
|
844
|
+
"Response validation failed"
|
|
845
|
+
);
|
|
846
|
+
throw result;
|
|
847
|
+
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
848
|
+
const responseBody = await response.json();
|
|
849
|
+
const result = schemas$.parse(
|
|
850
|
+
responseBody,
|
|
851
|
+
(val$) => {
|
|
852
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
853
|
+
...responseFields$,
|
|
854
|
+
...val$,
|
|
855
|
+
});
|
|
856
|
+
},
|
|
857
|
+
"Response validation failed"
|
|
858
|
+
);
|
|
859
|
+
throw result;
|
|
860
|
+
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
861
|
+
const responseBody = await response.json();
|
|
862
|
+
const result = schemas$.parse(
|
|
863
|
+
responseBody,
|
|
864
|
+
(val$) => {
|
|
865
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
866
|
+
...responseFields$,
|
|
867
|
+
...val$,
|
|
868
|
+
});
|
|
869
|
+
},
|
|
870
|
+
"Response validation failed"
|
|
871
|
+
);
|
|
872
|
+
throw result;
|
|
873
|
+
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
874
|
+
const responseBody = await response.json();
|
|
875
|
+
const result = schemas$.parse(
|
|
876
|
+
responseBody,
|
|
877
|
+
(val$) => {
|
|
878
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
879
|
+
...responseFields$,
|
|
880
|
+
...val$,
|
|
881
|
+
});
|
|
882
|
+
},
|
|
883
|
+
"Response validation failed"
|
|
884
|
+
);
|
|
885
|
+
throw result;
|
|
886
|
+
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
887
|
+
const responseBody = await response.json();
|
|
888
|
+
const result = schemas$.parse(
|
|
889
|
+
responseBody,
|
|
890
|
+
(val$) => {
|
|
891
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
892
|
+
...responseFields$,
|
|
893
|
+
...val$,
|
|
894
|
+
});
|
|
895
|
+
},
|
|
896
|
+
"Response validation failed"
|
|
897
|
+
);
|
|
898
|
+
throw result;
|
|
899
|
+
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
900
|
+
const responseBody = await response.json();
|
|
901
|
+
const result = schemas$.parse(
|
|
902
|
+
responseBody,
|
|
903
|
+
(val$) => {
|
|
904
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
905
|
+
...responseFields$,
|
|
906
|
+
...val$,
|
|
907
|
+
});
|
|
908
|
+
},
|
|
909
|
+
"Response validation failed"
|
|
910
|
+
);
|
|
911
|
+
throw result;
|
|
912
|
+
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
913
|
+
const responseBody = await response.json();
|
|
914
|
+
const result = schemas$.parse(
|
|
915
|
+
responseBody,
|
|
916
|
+
(val$) => {
|
|
917
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
918
|
+
...responseFields$,
|
|
919
|
+
...val$,
|
|
920
|
+
});
|
|
921
|
+
},
|
|
922
|
+
"Response validation failed"
|
|
923
|
+
);
|
|
924
|
+
throw result;
|
|
925
|
+
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
926
|
+
const responseBody = await response.json();
|
|
927
|
+
const result = schemas$.parse(
|
|
928
|
+
responseBody,
|
|
929
|
+
(val$) => {
|
|
930
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
931
|
+
...responseFields$,
|
|
932
|
+
...val$,
|
|
933
|
+
});
|
|
934
|
+
},
|
|
935
|
+
"Response validation failed"
|
|
936
|
+
);
|
|
937
|
+
throw result;
|
|
938
|
+
} else {
|
|
939
|
+
const responseBody = await response.text();
|
|
940
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* Edit a link
|
|
946
|
+
*
|
|
947
|
+
* @remarks
|
|
948
|
+
* Edit a link for the authenticated workspace.
|
|
949
|
+
*/
|
|
950
|
+
async update(
|
|
951
|
+
linkId: string,
|
|
952
|
+
requestBody?: operations.EditLinkRequestBody | undefined,
|
|
953
|
+
options?: RequestOptions
|
|
954
|
+
): Promise<components.LinkSchema> {
|
|
955
|
+
const input$: operations.EditLinkRequest = {
|
|
956
|
+
linkId: linkId,
|
|
957
|
+
requestBody: requestBody,
|
|
958
|
+
};
|
|
959
|
+
const headers$ = new Headers();
|
|
960
|
+
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
961
|
+
headers$.set("Content-Type", "application/json");
|
|
962
|
+
headers$.set("Accept", "application/json");
|
|
963
|
+
|
|
964
|
+
const payload$ = schemas$.parse(
|
|
965
|
+
input$,
|
|
966
|
+
(value$) => operations.EditLinkRequest$.outboundSchema.parse(value$),
|
|
967
|
+
"Input validation failed"
|
|
968
|
+
);
|
|
969
|
+
const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true });
|
|
970
|
+
|
|
971
|
+
const pathParams$ = {
|
|
972
|
+
linkId: enc$.encodeSimple("linkId", payload$.linkId, {
|
|
973
|
+
explode: false,
|
|
974
|
+
charEncoding: "percent",
|
|
975
|
+
}),
|
|
976
|
+
};
|
|
977
|
+
const path$ = this.templateURLComponent("/links/{linkId}")(pathParams$);
|
|
978
|
+
|
|
979
|
+
const query$ = [
|
|
980
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
981
|
+
explode: true,
|
|
982
|
+
charEncoding: "percent",
|
|
983
|
+
}),
|
|
984
|
+
]
|
|
985
|
+
.filter(Boolean)
|
|
986
|
+
.join("&");
|
|
987
|
+
|
|
988
|
+
let security$;
|
|
989
|
+
if (typeof this.options$.token === "function") {
|
|
990
|
+
security$ = { token: await this.options$.token() };
|
|
991
|
+
} else if (this.options$.token) {
|
|
992
|
+
security$ = { token: this.options$.token };
|
|
993
|
+
} else {
|
|
994
|
+
security$ = {};
|
|
995
|
+
}
|
|
996
|
+
const context = {
|
|
997
|
+
operationID: "editLink",
|
|
998
|
+
oAuth2Scopes: [],
|
|
999
|
+
securitySource: this.options$.token,
|
|
1000
|
+
};
|
|
1001
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
1002
|
+
|
|
1003
|
+
const doOptions = {
|
|
1004
|
+
context,
|
|
1005
|
+
errorCodes: [
|
|
1006
|
+
"400",
|
|
1007
|
+
"401",
|
|
1008
|
+
"403",
|
|
1009
|
+
"404",
|
|
1010
|
+
"409",
|
|
1011
|
+
"410",
|
|
1012
|
+
"422",
|
|
1013
|
+
"429",
|
|
1014
|
+
"4XX",
|
|
1015
|
+
"500",
|
|
1016
|
+
"5XX",
|
|
1017
|
+
],
|
|
1018
|
+
};
|
|
1019
|
+
const request = this.createRequest$(
|
|
1020
|
+
{
|
|
1021
|
+
security: securitySettings$,
|
|
1022
|
+
method: "PUT",
|
|
1023
|
+
path: path$,
|
|
1024
|
+
headers: headers$,
|
|
1025
|
+
query: query$,
|
|
1026
|
+
body: body$,
|
|
1027
|
+
},
|
|
1028
|
+
options
|
|
1029
|
+
);
|
|
1030
|
+
|
|
1031
|
+
const response = await this.do$(request, doOptions);
|
|
1032
|
+
|
|
1033
|
+
const responseFields$ = {
|
|
1034
|
+
HttpMeta: {
|
|
1035
|
+
Response: response,
|
|
1036
|
+
Request: request,
|
|
1037
|
+
},
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
1041
|
+
const responseBody = await response.json();
|
|
1042
|
+
const result = schemas$.parse(
|
|
1043
|
+
responseBody,
|
|
1044
|
+
(val$) => {
|
|
1045
|
+
return components.LinkSchema$.inboundSchema.parse(val$);
|
|
1046
|
+
},
|
|
1047
|
+
"Response validation failed"
|
|
1048
|
+
);
|
|
1049
|
+
return result;
|
|
1050
|
+
} else if (this.matchResponse(response, 400, "application/json")) {
|
|
1051
|
+
const responseBody = await response.json();
|
|
1052
|
+
const result = schemas$.parse(
|
|
1053
|
+
responseBody,
|
|
1054
|
+
(val$) => {
|
|
1055
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
1056
|
+
...responseFields$,
|
|
1057
|
+
...val$,
|
|
1058
|
+
});
|
|
1059
|
+
},
|
|
1060
|
+
"Response validation failed"
|
|
1061
|
+
);
|
|
1062
|
+
throw result;
|
|
1063
|
+
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
1064
|
+
const responseBody = await response.json();
|
|
1065
|
+
const result = schemas$.parse(
|
|
1066
|
+
responseBody,
|
|
1067
|
+
(val$) => {
|
|
1068
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
1069
|
+
...responseFields$,
|
|
1070
|
+
...val$,
|
|
1071
|
+
});
|
|
1072
|
+
},
|
|
1073
|
+
"Response validation failed"
|
|
1074
|
+
);
|
|
1075
|
+
throw result;
|
|
1076
|
+
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
1077
|
+
const responseBody = await response.json();
|
|
1078
|
+
const result = schemas$.parse(
|
|
1079
|
+
responseBody,
|
|
1080
|
+
(val$) => {
|
|
1081
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
1082
|
+
...responseFields$,
|
|
1083
|
+
...val$,
|
|
1084
|
+
});
|
|
1085
|
+
},
|
|
1086
|
+
"Response validation failed"
|
|
1087
|
+
);
|
|
1088
|
+
throw result;
|
|
1089
|
+
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
1090
|
+
const responseBody = await response.json();
|
|
1091
|
+
const result = schemas$.parse(
|
|
1092
|
+
responseBody,
|
|
1093
|
+
(val$) => {
|
|
1094
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
1095
|
+
...responseFields$,
|
|
1096
|
+
...val$,
|
|
1097
|
+
});
|
|
1098
|
+
},
|
|
1099
|
+
"Response validation failed"
|
|
1100
|
+
);
|
|
1101
|
+
throw result;
|
|
1102
|
+
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
1103
|
+
const responseBody = await response.json();
|
|
1104
|
+
const result = schemas$.parse(
|
|
1105
|
+
responseBody,
|
|
1106
|
+
(val$) => {
|
|
1107
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
1108
|
+
...responseFields$,
|
|
1109
|
+
...val$,
|
|
1110
|
+
});
|
|
1111
|
+
},
|
|
1112
|
+
"Response validation failed"
|
|
1113
|
+
);
|
|
1114
|
+
throw result;
|
|
1115
|
+
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
1116
|
+
const responseBody = await response.json();
|
|
1117
|
+
const result = schemas$.parse(
|
|
1118
|
+
responseBody,
|
|
1119
|
+
(val$) => {
|
|
1120
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
1121
|
+
...responseFields$,
|
|
1122
|
+
...val$,
|
|
1123
|
+
});
|
|
1124
|
+
},
|
|
1125
|
+
"Response validation failed"
|
|
1126
|
+
);
|
|
1127
|
+
throw result;
|
|
1128
|
+
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
1129
|
+
const responseBody = await response.json();
|
|
1130
|
+
const result = schemas$.parse(
|
|
1131
|
+
responseBody,
|
|
1132
|
+
(val$) => {
|
|
1133
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
1134
|
+
...responseFields$,
|
|
1135
|
+
...val$,
|
|
1136
|
+
});
|
|
1137
|
+
},
|
|
1138
|
+
"Response validation failed"
|
|
1139
|
+
);
|
|
1140
|
+
throw result;
|
|
1141
|
+
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
1142
|
+
const responseBody = await response.json();
|
|
1143
|
+
const result = schemas$.parse(
|
|
1144
|
+
responseBody,
|
|
1145
|
+
(val$) => {
|
|
1146
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
1147
|
+
...responseFields$,
|
|
1148
|
+
...val$,
|
|
1149
|
+
});
|
|
1150
|
+
},
|
|
1151
|
+
"Response validation failed"
|
|
1152
|
+
);
|
|
1153
|
+
throw result;
|
|
1154
|
+
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
1155
|
+
const responseBody = await response.json();
|
|
1156
|
+
const result = schemas$.parse(
|
|
1157
|
+
responseBody,
|
|
1158
|
+
(val$) => {
|
|
1159
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
1160
|
+
...responseFields$,
|
|
1161
|
+
...val$,
|
|
1162
|
+
});
|
|
1163
|
+
},
|
|
1164
|
+
"Response validation failed"
|
|
1165
|
+
);
|
|
1166
|
+
throw result;
|
|
1167
|
+
} else {
|
|
1168
|
+
const responseBody = await response.text();
|
|
1169
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* Delete a link
|
|
1175
|
+
*
|
|
1176
|
+
* @remarks
|
|
1177
|
+
* Delete a link for the authenticated workspace.
|
|
1178
|
+
*/
|
|
1179
|
+
async delete(
|
|
1180
|
+
linkId: string,
|
|
1181
|
+
options?: RequestOptions
|
|
1182
|
+
): Promise<operations.DeleteLinkResponseBody> {
|
|
1183
|
+
const input$: operations.DeleteLinkRequest = {
|
|
1184
|
+
linkId: linkId,
|
|
1185
|
+
};
|
|
1186
|
+
const headers$ = new Headers();
|
|
1187
|
+
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
1188
|
+
headers$.set("Accept", "application/json");
|
|
1189
|
+
|
|
1190
|
+
const payload$ = schemas$.parse(
|
|
1191
|
+
input$,
|
|
1192
|
+
(value$) => operations.DeleteLinkRequest$.outboundSchema.parse(value$),
|
|
1193
|
+
"Input validation failed"
|
|
1194
|
+
);
|
|
1195
|
+
const body$ = null;
|
|
1196
|
+
|
|
1197
|
+
const pathParams$ = {
|
|
1198
|
+
linkId: enc$.encodeSimple("linkId", payload$.linkId, {
|
|
1199
|
+
explode: false,
|
|
1200
|
+
charEncoding: "percent",
|
|
1201
|
+
}),
|
|
1202
|
+
};
|
|
1203
|
+
const path$ = this.templateURLComponent("/links/{linkId}")(pathParams$);
|
|
1204
|
+
|
|
1205
|
+
const query$ = [
|
|
1206
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
1207
|
+
explode: true,
|
|
1208
|
+
charEncoding: "percent",
|
|
1209
|
+
}),
|
|
1210
|
+
]
|
|
1211
|
+
.filter(Boolean)
|
|
1212
|
+
.join("&");
|
|
1213
|
+
|
|
1214
|
+
let security$;
|
|
1215
|
+
if (typeof this.options$.token === "function") {
|
|
1216
|
+
security$ = { token: await this.options$.token() };
|
|
1217
|
+
} else if (this.options$.token) {
|
|
1218
|
+
security$ = { token: this.options$.token };
|
|
1219
|
+
} else {
|
|
1220
|
+
security$ = {};
|
|
1221
|
+
}
|
|
1222
|
+
const context = {
|
|
1223
|
+
operationID: "deleteLink",
|
|
1224
|
+
oAuth2Scopes: [],
|
|
1225
|
+
securitySource: this.options$.token,
|
|
1226
|
+
};
|
|
1227
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
1228
|
+
|
|
1229
|
+
const doOptions = {
|
|
1230
|
+
context,
|
|
1231
|
+
errorCodes: [
|
|
1232
|
+
"400",
|
|
1233
|
+
"401",
|
|
1234
|
+
"403",
|
|
1235
|
+
"404",
|
|
1236
|
+
"409",
|
|
1237
|
+
"410",
|
|
1238
|
+
"422",
|
|
1239
|
+
"429",
|
|
1240
|
+
"4XX",
|
|
1241
|
+
"500",
|
|
1242
|
+
"5XX",
|
|
1243
|
+
],
|
|
1244
|
+
};
|
|
1245
|
+
const request = this.createRequest$(
|
|
1246
|
+
{
|
|
1247
|
+
security: securitySettings$,
|
|
1248
|
+
method: "DELETE",
|
|
1249
|
+
path: path$,
|
|
1250
|
+
headers: headers$,
|
|
1251
|
+
query: query$,
|
|
1252
|
+
body: body$,
|
|
1253
|
+
},
|
|
1254
|
+
options
|
|
1255
|
+
);
|
|
1256
|
+
|
|
1257
|
+
const response = await this.do$(request, doOptions);
|
|
1258
|
+
|
|
1259
|
+
const responseFields$ = {
|
|
1260
|
+
HttpMeta: {
|
|
1261
|
+
Response: response,
|
|
1262
|
+
Request: request,
|
|
1263
|
+
},
|
|
1264
|
+
};
|
|
1265
|
+
|
|
1266
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
1267
|
+
const responseBody = await response.json();
|
|
1268
|
+
const result = schemas$.parse(
|
|
1269
|
+
responseBody,
|
|
1270
|
+
(val$) => {
|
|
1271
|
+
return operations.DeleteLinkResponseBody$.inboundSchema.parse(val$);
|
|
1272
|
+
},
|
|
1273
|
+
"Response validation failed"
|
|
1274
|
+
);
|
|
1275
|
+
return result;
|
|
1276
|
+
} else if (this.matchResponse(response, 400, "application/json")) {
|
|
1277
|
+
const responseBody = await response.json();
|
|
1278
|
+
const result = schemas$.parse(
|
|
1279
|
+
responseBody,
|
|
1280
|
+
(val$) => {
|
|
1281
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
1282
|
+
...responseFields$,
|
|
1283
|
+
...val$,
|
|
1284
|
+
});
|
|
1285
|
+
},
|
|
1286
|
+
"Response validation failed"
|
|
1287
|
+
);
|
|
1288
|
+
throw result;
|
|
1289
|
+
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
1290
|
+
const responseBody = await response.json();
|
|
1291
|
+
const result = schemas$.parse(
|
|
1292
|
+
responseBody,
|
|
1293
|
+
(val$) => {
|
|
1294
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
1295
|
+
...responseFields$,
|
|
1296
|
+
...val$,
|
|
1297
|
+
});
|
|
1298
|
+
},
|
|
1299
|
+
"Response validation failed"
|
|
1300
|
+
);
|
|
1301
|
+
throw result;
|
|
1302
|
+
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
1303
|
+
const responseBody = await response.json();
|
|
1304
|
+
const result = schemas$.parse(
|
|
1305
|
+
responseBody,
|
|
1306
|
+
(val$) => {
|
|
1307
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
1308
|
+
...responseFields$,
|
|
1309
|
+
...val$,
|
|
1310
|
+
});
|
|
1311
|
+
},
|
|
1312
|
+
"Response validation failed"
|
|
1313
|
+
);
|
|
1314
|
+
throw result;
|
|
1315
|
+
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
1316
|
+
const responseBody = await response.json();
|
|
1317
|
+
const result = schemas$.parse(
|
|
1318
|
+
responseBody,
|
|
1319
|
+
(val$) => {
|
|
1320
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
1321
|
+
...responseFields$,
|
|
1322
|
+
...val$,
|
|
1323
|
+
});
|
|
1324
|
+
},
|
|
1325
|
+
"Response validation failed"
|
|
1326
|
+
);
|
|
1327
|
+
throw result;
|
|
1328
|
+
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
1329
|
+
const responseBody = await response.json();
|
|
1330
|
+
const result = schemas$.parse(
|
|
1331
|
+
responseBody,
|
|
1332
|
+
(val$) => {
|
|
1333
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
1334
|
+
...responseFields$,
|
|
1335
|
+
...val$,
|
|
1336
|
+
});
|
|
1337
|
+
},
|
|
1338
|
+
"Response validation failed"
|
|
1339
|
+
);
|
|
1340
|
+
throw result;
|
|
1341
|
+
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
1342
|
+
const responseBody = await response.json();
|
|
1343
|
+
const result = schemas$.parse(
|
|
1344
|
+
responseBody,
|
|
1345
|
+
(val$) => {
|
|
1346
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
1347
|
+
...responseFields$,
|
|
1348
|
+
...val$,
|
|
1349
|
+
});
|
|
1350
|
+
},
|
|
1351
|
+
"Response validation failed"
|
|
1352
|
+
);
|
|
1353
|
+
throw result;
|
|
1354
|
+
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
1355
|
+
const responseBody = await response.json();
|
|
1356
|
+
const result = schemas$.parse(
|
|
1357
|
+
responseBody,
|
|
1358
|
+
(val$) => {
|
|
1359
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
1360
|
+
...responseFields$,
|
|
1361
|
+
...val$,
|
|
1362
|
+
});
|
|
1363
|
+
},
|
|
1364
|
+
"Response validation failed"
|
|
1365
|
+
);
|
|
1366
|
+
throw result;
|
|
1367
|
+
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
1368
|
+
const responseBody = await response.json();
|
|
1369
|
+
const result = schemas$.parse(
|
|
1370
|
+
responseBody,
|
|
1371
|
+
(val$) => {
|
|
1372
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
1373
|
+
...responseFields$,
|
|
1374
|
+
...val$,
|
|
1375
|
+
});
|
|
1376
|
+
},
|
|
1377
|
+
"Response validation failed"
|
|
1378
|
+
);
|
|
1379
|
+
throw result;
|
|
1380
|
+
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
1381
|
+
const responseBody = await response.json();
|
|
1382
|
+
const result = schemas$.parse(
|
|
1383
|
+
responseBody,
|
|
1384
|
+
(val$) => {
|
|
1385
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
1386
|
+
...responseFields$,
|
|
1387
|
+
...val$,
|
|
1388
|
+
});
|
|
1389
|
+
},
|
|
1390
|
+
"Response validation failed"
|
|
1391
|
+
);
|
|
1392
|
+
throw result;
|
|
1393
|
+
} else {
|
|
1394
|
+
const responseBody = await response.text();
|
|
1395
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
/**
|
|
1400
|
+
* Bulk create links
|
|
1401
|
+
*
|
|
1402
|
+
* @remarks
|
|
1403
|
+
* Bulk create up to 100 links for the authenticated workspace.
|
|
1404
|
+
*/
|
|
1405
|
+
async createMany(
|
|
1406
|
+
input: Array<operations.RequestBody> | undefined,
|
|
1407
|
+
options?: RequestOptions
|
|
1408
|
+
): Promise<Array<components.LinkSchema>> {
|
|
1409
|
+
const headers$ = new Headers();
|
|
1410
|
+
headers$.set("user-agent", SDK_METADATA.userAgent);
|
|
1411
|
+
headers$.set("Content-Type", "application/json");
|
|
1412
|
+
headers$.set("Accept", "application/json");
|
|
1413
|
+
|
|
1414
|
+
const payload$ = schemas$.parse(
|
|
1415
|
+
input,
|
|
1416
|
+
(value$) => z.array(operations.RequestBody$.outboundSchema).optional().parse(value$),
|
|
1417
|
+
"Input validation failed"
|
|
1418
|
+
);
|
|
1419
|
+
const body$ =
|
|
1420
|
+
payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true });
|
|
1421
|
+
|
|
1422
|
+
const path$ = this.templateURLComponent("/links/bulk")();
|
|
1423
|
+
|
|
1424
|
+
const query$ = [
|
|
1425
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
1426
|
+
explode: true,
|
|
1427
|
+
charEncoding: "percent",
|
|
1428
|
+
}),
|
|
1429
|
+
]
|
|
1430
|
+
.filter(Boolean)
|
|
1431
|
+
.join("&");
|
|
1432
|
+
|
|
1433
|
+
let security$;
|
|
1434
|
+
if (typeof this.options$.token === "function") {
|
|
1435
|
+
security$ = { token: await this.options$.token() };
|
|
1436
|
+
} else if (this.options$.token) {
|
|
1437
|
+
security$ = { token: this.options$.token };
|
|
1438
|
+
} else {
|
|
1439
|
+
security$ = {};
|
|
1440
|
+
}
|
|
1441
|
+
const context = {
|
|
1442
|
+
operationID: "bulkCreateLinks",
|
|
1443
|
+
oAuth2Scopes: [],
|
|
1444
|
+
securitySource: this.options$.token,
|
|
1445
|
+
};
|
|
1446
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
1447
|
+
|
|
1448
|
+
const doOptions = {
|
|
1449
|
+
context,
|
|
1450
|
+
errorCodes: [
|
|
1451
|
+
"400",
|
|
1452
|
+
"401",
|
|
1453
|
+
"403",
|
|
1454
|
+
"404",
|
|
1455
|
+
"409",
|
|
1456
|
+
"410",
|
|
1457
|
+
"422",
|
|
1458
|
+
"429",
|
|
1459
|
+
"4XX",
|
|
1460
|
+
"500",
|
|
1461
|
+
"5XX",
|
|
1462
|
+
],
|
|
1463
|
+
};
|
|
1464
|
+
const request = this.createRequest$(
|
|
1465
|
+
{
|
|
1466
|
+
security: securitySettings$,
|
|
1467
|
+
method: "POST",
|
|
1468
|
+
path: path$,
|
|
1469
|
+
headers: headers$,
|
|
1470
|
+
query: query$,
|
|
1471
|
+
body: body$,
|
|
1472
|
+
},
|
|
1473
|
+
options
|
|
1474
|
+
);
|
|
1475
|
+
|
|
1476
|
+
const response = await this.do$(request, doOptions);
|
|
1477
|
+
|
|
1478
|
+
const responseFields$ = {
|
|
1479
|
+
HttpMeta: {
|
|
1480
|
+
Response: response,
|
|
1481
|
+
Request: request,
|
|
1482
|
+
},
|
|
1483
|
+
};
|
|
1484
|
+
|
|
1485
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
1486
|
+
const responseBody = await response.json();
|
|
1487
|
+
const result = schemas$.parse(
|
|
1488
|
+
responseBody,
|
|
1489
|
+
(val$) => {
|
|
1490
|
+
return z.array(components.LinkSchema$.inboundSchema).parse(val$);
|
|
1491
|
+
},
|
|
1492
|
+
"Response validation failed"
|
|
1493
|
+
);
|
|
1494
|
+
return result;
|
|
1495
|
+
} else if (this.matchResponse(response, 400, "application/json")) {
|
|
1496
|
+
const responseBody = await response.json();
|
|
1497
|
+
const result = schemas$.parse(
|
|
1498
|
+
responseBody,
|
|
1499
|
+
(val$) => {
|
|
1500
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
1501
|
+
...responseFields$,
|
|
1502
|
+
...val$,
|
|
1503
|
+
});
|
|
1504
|
+
},
|
|
1505
|
+
"Response validation failed"
|
|
1506
|
+
);
|
|
1507
|
+
throw result;
|
|
1508
|
+
} else if (this.matchResponse(response, 401, "application/json")) {
|
|
1509
|
+
const responseBody = await response.json();
|
|
1510
|
+
const result = schemas$.parse(
|
|
1511
|
+
responseBody,
|
|
1512
|
+
(val$) => {
|
|
1513
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
1514
|
+
...responseFields$,
|
|
1515
|
+
...val$,
|
|
1516
|
+
});
|
|
1517
|
+
},
|
|
1518
|
+
"Response validation failed"
|
|
1519
|
+
);
|
|
1520
|
+
throw result;
|
|
1521
|
+
} else if (this.matchResponse(response, 403, "application/json")) {
|
|
1522
|
+
const responseBody = await response.json();
|
|
1523
|
+
const result = schemas$.parse(
|
|
1524
|
+
responseBody,
|
|
1525
|
+
(val$) => {
|
|
1526
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
1527
|
+
...responseFields$,
|
|
1528
|
+
...val$,
|
|
1529
|
+
});
|
|
1530
|
+
},
|
|
1531
|
+
"Response validation failed"
|
|
1532
|
+
);
|
|
1533
|
+
throw result;
|
|
1534
|
+
} else if (this.matchResponse(response, 404, "application/json")) {
|
|
1535
|
+
const responseBody = await response.json();
|
|
1536
|
+
const result = schemas$.parse(
|
|
1537
|
+
responseBody,
|
|
1538
|
+
(val$) => {
|
|
1539
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
1540
|
+
...responseFields$,
|
|
1541
|
+
...val$,
|
|
1542
|
+
});
|
|
1543
|
+
},
|
|
1544
|
+
"Response validation failed"
|
|
1545
|
+
);
|
|
1546
|
+
throw result;
|
|
1547
|
+
} else if (this.matchResponse(response, 409, "application/json")) {
|
|
1548
|
+
const responseBody = await response.json();
|
|
1549
|
+
const result = schemas$.parse(
|
|
1550
|
+
responseBody,
|
|
1551
|
+
(val$) => {
|
|
1552
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
1553
|
+
...responseFields$,
|
|
1554
|
+
...val$,
|
|
1555
|
+
});
|
|
1556
|
+
},
|
|
1557
|
+
"Response validation failed"
|
|
1558
|
+
);
|
|
1559
|
+
throw result;
|
|
1560
|
+
} else if (this.matchResponse(response, 410, "application/json")) {
|
|
1561
|
+
const responseBody = await response.json();
|
|
1562
|
+
const result = schemas$.parse(
|
|
1563
|
+
responseBody,
|
|
1564
|
+
(val$) => {
|
|
1565
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
1566
|
+
...responseFields$,
|
|
1567
|
+
...val$,
|
|
1568
|
+
});
|
|
1569
|
+
},
|
|
1570
|
+
"Response validation failed"
|
|
1571
|
+
);
|
|
1572
|
+
throw result;
|
|
1573
|
+
} else if (this.matchResponse(response, 422, "application/json")) {
|
|
1574
|
+
const responseBody = await response.json();
|
|
1575
|
+
const result = schemas$.parse(
|
|
1576
|
+
responseBody,
|
|
1577
|
+
(val$) => {
|
|
1578
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
1579
|
+
...responseFields$,
|
|
1580
|
+
...val$,
|
|
1581
|
+
});
|
|
1582
|
+
},
|
|
1583
|
+
"Response validation failed"
|
|
1584
|
+
);
|
|
1585
|
+
throw result;
|
|
1586
|
+
} else if (this.matchResponse(response, 429, "application/json")) {
|
|
1587
|
+
const responseBody = await response.json();
|
|
1588
|
+
const result = schemas$.parse(
|
|
1589
|
+
responseBody,
|
|
1590
|
+
(val$) => {
|
|
1591
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
1592
|
+
...responseFields$,
|
|
1593
|
+
...val$,
|
|
1594
|
+
});
|
|
1595
|
+
},
|
|
1596
|
+
"Response validation failed"
|
|
1597
|
+
);
|
|
1598
|
+
throw result;
|
|
1599
|
+
} else if (this.matchResponse(response, 500, "application/json")) {
|
|
1600
|
+
const responseBody = await response.json();
|
|
1601
|
+
const result = schemas$.parse(
|
|
1602
|
+
responseBody,
|
|
1603
|
+
(val$) => {
|
|
1604
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
1605
|
+
...responseFields$,
|
|
1606
|
+
...val$,
|
|
1607
|
+
});
|
|
1608
|
+
},
|
|
1609
|
+
"Response validation failed"
|
|
1610
|
+
);
|
|
1611
|
+
throw result;
|
|
1612
|
+
} else {
|
|
1613
|
+
const responseBody = await response.text();
|
|
1614
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
}
|