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/sdk/links.js
ADDED
|
@@ -0,0 +1,1309 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Links = void 0;
|
|
30
|
+
const hooks_1 = require("../hooks");
|
|
31
|
+
const config_1 = require("../lib/config");
|
|
32
|
+
const enc$ = __importStar(require("../lib/encodings"));
|
|
33
|
+
const http_1 = require("../lib/http");
|
|
34
|
+
const schemas$ = __importStar(require("../lib/schemas"));
|
|
35
|
+
const sdks_1 = require("../lib/sdks");
|
|
36
|
+
const components = __importStar(require("../models/components"));
|
|
37
|
+
const errors = __importStar(require("../models/errors"));
|
|
38
|
+
const operations = __importStar(require("../models/operations"));
|
|
39
|
+
const z = __importStar(require("zod"));
|
|
40
|
+
class Links extends sdks_1.ClientSDK {
|
|
41
|
+
constructor(options = {}) {
|
|
42
|
+
const opt = options;
|
|
43
|
+
let hooks;
|
|
44
|
+
if (typeof opt === "object" &&
|
|
45
|
+
opt != null &&
|
|
46
|
+
"hooks" in opt &&
|
|
47
|
+
opt.hooks instanceof hooks_1.SDKHooks) {
|
|
48
|
+
hooks = opt.hooks;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
hooks = new hooks_1.SDKHooks();
|
|
52
|
+
}
|
|
53
|
+
super({
|
|
54
|
+
client: options.httpClient || new http_1.HTTPClient(),
|
|
55
|
+
baseURL: (0, config_1.serverURLFromOptions)(options),
|
|
56
|
+
hooks,
|
|
57
|
+
});
|
|
58
|
+
this.options$ = { ...options, hooks };
|
|
59
|
+
void this.options$;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Retrieve a list of links
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* Retrieve a list of links for the authenticated workspace. The list will be paginated and the provided query parameters allow filtering the returned links.
|
|
66
|
+
*/
|
|
67
|
+
async list(input, options) {
|
|
68
|
+
const headers$ = new Headers();
|
|
69
|
+
headers$.set("user-agent", config_1.SDK_METADATA.userAgent);
|
|
70
|
+
headers$.set("Accept", "application/json");
|
|
71
|
+
const payload$ = schemas$.parse(input, (value$) => operations.GetLinksRequest$.outboundSchema.parse(value$), "Input validation failed");
|
|
72
|
+
const body$ = null;
|
|
73
|
+
const path$ = this.templateURLComponent("/links")();
|
|
74
|
+
const query$ = [
|
|
75
|
+
enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }),
|
|
76
|
+
enc$.encodeForm("page", payload$.page, { explode: true, charEncoding: "percent" }),
|
|
77
|
+
enc$.encodeForm("search", payload$.search, { explode: true, charEncoding: "percent" }),
|
|
78
|
+
enc$.encodeForm("showArchived", payload$.showArchived, {
|
|
79
|
+
explode: true,
|
|
80
|
+
charEncoding: "percent",
|
|
81
|
+
}),
|
|
82
|
+
enc$.encodeForm("sort", payload$.sort, { explode: true, charEncoding: "percent" }),
|
|
83
|
+
enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }),
|
|
84
|
+
enc$.encodeForm("tagIds", payload$.tagIds, { explode: true, charEncoding: "percent" }),
|
|
85
|
+
enc$.encodeForm("userId", payload$.userId, { explode: true, charEncoding: "percent" }),
|
|
86
|
+
enc$.encodeForm("withTags", payload$.withTags, {
|
|
87
|
+
explode: true,
|
|
88
|
+
charEncoding: "percent",
|
|
89
|
+
}),
|
|
90
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
91
|
+
explode: true,
|
|
92
|
+
charEncoding: "percent",
|
|
93
|
+
}),
|
|
94
|
+
]
|
|
95
|
+
.filter(Boolean)
|
|
96
|
+
.join("&");
|
|
97
|
+
let security$;
|
|
98
|
+
if (typeof this.options$.token === "function") {
|
|
99
|
+
security$ = { token: await this.options$.token() };
|
|
100
|
+
}
|
|
101
|
+
else if (this.options$.token) {
|
|
102
|
+
security$ = { token: this.options$.token };
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
security$ = {};
|
|
106
|
+
}
|
|
107
|
+
const context = {
|
|
108
|
+
operationID: "getLinks",
|
|
109
|
+
oAuth2Scopes: [],
|
|
110
|
+
securitySource: this.options$.token,
|
|
111
|
+
};
|
|
112
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
113
|
+
const doOptions = {
|
|
114
|
+
context,
|
|
115
|
+
errorCodes: [
|
|
116
|
+
"400",
|
|
117
|
+
"401",
|
|
118
|
+
"403",
|
|
119
|
+
"404",
|
|
120
|
+
"409",
|
|
121
|
+
"410",
|
|
122
|
+
"422",
|
|
123
|
+
"429",
|
|
124
|
+
"4XX",
|
|
125
|
+
"500",
|
|
126
|
+
"5XX",
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
const request = this.createRequest$({
|
|
130
|
+
security: securitySettings$,
|
|
131
|
+
method: "GET",
|
|
132
|
+
path: path$,
|
|
133
|
+
headers: headers$,
|
|
134
|
+
query: query$,
|
|
135
|
+
body: body$,
|
|
136
|
+
}, options);
|
|
137
|
+
const response = await this.do$(request, doOptions);
|
|
138
|
+
const responseFields$ = {
|
|
139
|
+
HttpMeta: {
|
|
140
|
+
Response: response,
|
|
141
|
+
Request: request,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
145
|
+
const responseBody = await response.json();
|
|
146
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
147
|
+
return z.array(components.LinkSchema$.inboundSchema).parse(val$);
|
|
148
|
+
}, "Response validation failed");
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
else if (this.matchResponse(response, 400, "application/json")) {
|
|
152
|
+
const responseBody = await response.json();
|
|
153
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
154
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
155
|
+
...responseFields$,
|
|
156
|
+
...val$,
|
|
157
|
+
});
|
|
158
|
+
}, "Response validation failed");
|
|
159
|
+
throw result;
|
|
160
|
+
}
|
|
161
|
+
else if (this.matchResponse(response, 401, "application/json")) {
|
|
162
|
+
const responseBody = await response.json();
|
|
163
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
164
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
165
|
+
...responseFields$,
|
|
166
|
+
...val$,
|
|
167
|
+
});
|
|
168
|
+
}, "Response validation failed");
|
|
169
|
+
throw result;
|
|
170
|
+
}
|
|
171
|
+
else if (this.matchResponse(response, 403, "application/json")) {
|
|
172
|
+
const responseBody = await response.json();
|
|
173
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
174
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
175
|
+
...responseFields$,
|
|
176
|
+
...val$,
|
|
177
|
+
});
|
|
178
|
+
}, "Response validation failed");
|
|
179
|
+
throw result;
|
|
180
|
+
}
|
|
181
|
+
else if (this.matchResponse(response, 404, "application/json")) {
|
|
182
|
+
const responseBody = await response.json();
|
|
183
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
184
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
185
|
+
...responseFields$,
|
|
186
|
+
...val$,
|
|
187
|
+
});
|
|
188
|
+
}, "Response validation failed");
|
|
189
|
+
throw result;
|
|
190
|
+
}
|
|
191
|
+
else if (this.matchResponse(response, 409, "application/json")) {
|
|
192
|
+
const responseBody = await response.json();
|
|
193
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
194
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
195
|
+
...responseFields$,
|
|
196
|
+
...val$,
|
|
197
|
+
});
|
|
198
|
+
}, "Response validation failed");
|
|
199
|
+
throw result;
|
|
200
|
+
}
|
|
201
|
+
else if (this.matchResponse(response, 410, "application/json")) {
|
|
202
|
+
const responseBody = await response.json();
|
|
203
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
204
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
205
|
+
...responseFields$,
|
|
206
|
+
...val$,
|
|
207
|
+
});
|
|
208
|
+
}, "Response validation failed");
|
|
209
|
+
throw result;
|
|
210
|
+
}
|
|
211
|
+
else if (this.matchResponse(response, 422, "application/json")) {
|
|
212
|
+
const responseBody = await response.json();
|
|
213
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
214
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
215
|
+
...responseFields$,
|
|
216
|
+
...val$,
|
|
217
|
+
});
|
|
218
|
+
}, "Response validation failed");
|
|
219
|
+
throw result;
|
|
220
|
+
}
|
|
221
|
+
else if (this.matchResponse(response, 429, "application/json")) {
|
|
222
|
+
const responseBody = await response.json();
|
|
223
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
224
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
225
|
+
...responseFields$,
|
|
226
|
+
...val$,
|
|
227
|
+
});
|
|
228
|
+
}, "Response validation failed");
|
|
229
|
+
throw result;
|
|
230
|
+
}
|
|
231
|
+
else if (this.matchResponse(response, 500, "application/json")) {
|
|
232
|
+
const responseBody = await response.json();
|
|
233
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
234
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
235
|
+
...responseFields$,
|
|
236
|
+
...val$,
|
|
237
|
+
});
|
|
238
|
+
}, "Response validation failed");
|
|
239
|
+
throw result;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
const responseBody = await response.text();
|
|
243
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Create a new link
|
|
248
|
+
*
|
|
249
|
+
* @remarks
|
|
250
|
+
* Create a new link for the authenticated workspace.
|
|
251
|
+
*/
|
|
252
|
+
async create(input, options) {
|
|
253
|
+
const headers$ = new Headers();
|
|
254
|
+
headers$.set("user-agent", config_1.SDK_METADATA.userAgent);
|
|
255
|
+
headers$.set("Content-Type", "application/json");
|
|
256
|
+
headers$.set("Accept", "application/json");
|
|
257
|
+
const payload$ = schemas$.parse(input, (value$) => operations.CreateLinkRequestBody$.outboundSchema.optional().parse(value$), "Input validation failed");
|
|
258
|
+
const body$ = payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true });
|
|
259
|
+
const path$ = this.templateURLComponent("/links")();
|
|
260
|
+
const query$ = [
|
|
261
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
262
|
+
explode: true,
|
|
263
|
+
charEncoding: "percent",
|
|
264
|
+
}),
|
|
265
|
+
]
|
|
266
|
+
.filter(Boolean)
|
|
267
|
+
.join("&");
|
|
268
|
+
let security$;
|
|
269
|
+
if (typeof this.options$.token === "function") {
|
|
270
|
+
security$ = { token: await this.options$.token() };
|
|
271
|
+
}
|
|
272
|
+
else if (this.options$.token) {
|
|
273
|
+
security$ = { token: this.options$.token };
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
security$ = {};
|
|
277
|
+
}
|
|
278
|
+
const context = {
|
|
279
|
+
operationID: "createLink",
|
|
280
|
+
oAuth2Scopes: [],
|
|
281
|
+
securitySource: this.options$.token,
|
|
282
|
+
};
|
|
283
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
284
|
+
const doOptions = {
|
|
285
|
+
context,
|
|
286
|
+
errorCodes: [
|
|
287
|
+
"400",
|
|
288
|
+
"401",
|
|
289
|
+
"403",
|
|
290
|
+
"404",
|
|
291
|
+
"409",
|
|
292
|
+
"410",
|
|
293
|
+
"422",
|
|
294
|
+
"429",
|
|
295
|
+
"4XX",
|
|
296
|
+
"500",
|
|
297
|
+
"5XX",
|
|
298
|
+
],
|
|
299
|
+
};
|
|
300
|
+
const request = this.createRequest$({
|
|
301
|
+
security: securitySettings$,
|
|
302
|
+
method: "POST",
|
|
303
|
+
path: path$,
|
|
304
|
+
headers: headers$,
|
|
305
|
+
query: query$,
|
|
306
|
+
body: body$,
|
|
307
|
+
}, options);
|
|
308
|
+
const response = await this.do$(request, doOptions);
|
|
309
|
+
const responseFields$ = {
|
|
310
|
+
HttpMeta: {
|
|
311
|
+
Response: response,
|
|
312
|
+
Request: request,
|
|
313
|
+
},
|
|
314
|
+
};
|
|
315
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
316
|
+
const responseBody = await response.json();
|
|
317
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
318
|
+
return components.LinkSchema$.inboundSchema.parse(val$);
|
|
319
|
+
}, "Response validation failed");
|
|
320
|
+
return result;
|
|
321
|
+
}
|
|
322
|
+
else if (this.matchResponse(response, 400, "application/json")) {
|
|
323
|
+
const responseBody = await response.json();
|
|
324
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
325
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
326
|
+
...responseFields$,
|
|
327
|
+
...val$,
|
|
328
|
+
});
|
|
329
|
+
}, "Response validation failed");
|
|
330
|
+
throw result;
|
|
331
|
+
}
|
|
332
|
+
else if (this.matchResponse(response, 401, "application/json")) {
|
|
333
|
+
const responseBody = await response.json();
|
|
334
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
335
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
336
|
+
...responseFields$,
|
|
337
|
+
...val$,
|
|
338
|
+
});
|
|
339
|
+
}, "Response validation failed");
|
|
340
|
+
throw result;
|
|
341
|
+
}
|
|
342
|
+
else if (this.matchResponse(response, 403, "application/json")) {
|
|
343
|
+
const responseBody = await response.json();
|
|
344
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
345
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
346
|
+
...responseFields$,
|
|
347
|
+
...val$,
|
|
348
|
+
});
|
|
349
|
+
}, "Response validation failed");
|
|
350
|
+
throw result;
|
|
351
|
+
}
|
|
352
|
+
else if (this.matchResponse(response, 404, "application/json")) {
|
|
353
|
+
const responseBody = await response.json();
|
|
354
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
355
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
356
|
+
...responseFields$,
|
|
357
|
+
...val$,
|
|
358
|
+
});
|
|
359
|
+
}, "Response validation failed");
|
|
360
|
+
throw result;
|
|
361
|
+
}
|
|
362
|
+
else if (this.matchResponse(response, 409, "application/json")) {
|
|
363
|
+
const responseBody = await response.json();
|
|
364
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
365
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
366
|
+
...responseFields$,
|
|
367
|
+
...val$,
|
|
368
|
+
});
|
|
369
|
+
}, "Response validation failed");
|
|
370
|
+
throw result;
|
|
371
|
+
}
|
|
372
|
+
else if (this.matchResponse(response, 410, "application/json")) {
|
|
373
|
+
const responseBody = await response.json();
|
|
374
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
375
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
376
|
+
...responseFields$,
|
|
377
|
+
...val$,
|
|
378
|
+
});
|
|
379
|
+
}, "Response validation failed");
|
|
380
|
+
throw result;
|
|
381
|
+
}
|
|
382
|
+
else if (this.matchResponse(response, 422, "application/json")) {
|
|
383
|
+
const responseBody = await response.json();
|
|
384
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
385
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
386
|
+
...responseFields$,
|
|
387
|
+
...val$,
|
|
388
|
+
});
|
|
389
|
+
}, "Response validation failed");
|
|
390
|
+
throw result;
|
|
391
|
+
}
|
|
392
|
+
else if (this.matchResponse(response, 429, "application/json")) {
|
|
393
|
+
const responseBody = await response.json();
|
|
394
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
395
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
396
|
+
...responseFields$,
|
|
397
|
+
...val$,
|
|
398
|
+
});
|
|
399
|
+
}, "Response validation failed");
|
|
400
|
+
throw result;
|
|
401
|
+
}
|
|
402
|
+
else if (this.matchResponse(response, 500, "application/json")) {
|
|
403
|
+
const responseBody = await response.json();
|
|
404
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
405
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
406
|
+
...responseFields$,
|
|
407
|
+
...val$,
|
|
408
|
+
});
|
|
409
|
+
}, "Response validation failed");
|
|
410
|
+
throw result;
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
const responseBody = await response.text();
|
|
414
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Retrieve the number of links
|
|
419
|
+
*
|
|
420
|
+
* @remarks
|
|
421
|
+
* Retrieve the number of links for the authenticated workspace. The provided query parameters allow filtering the returned links.
|
|
422
|
+
*/
|
|
423
|
+
async count(input, options) {
|
|
424
|
+
const headers$ = new Headers();
|
|
425
|
+
headers$.set("user-agent", config_1.SDK_METADATA.userAgent);
|
|
426
|
+
headers$.set("Accept", "application/json");
|
|
427
|
+
const payload$ = schemas$.parse(input, (value$) => operations.GetLinksCountRequest$.outboundSchema.parse(value$), "Input validation failed");
|
|
428
|
+
const body$ = null;
|
|
429
|
+
const path$ = this.templateURLComponent("/links/count")();
|
|
430
|
+
const query$ = [
|
|
431
|
+
enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }),
|
|
432
|
+
enc$.encodeForm("groupBy", payload$.groupBy, {
|
|
433
|
+
explode: true,
|
|
434
|
+
charEncoding: "percent",
|
|
435
|
+
}),
|
|
436
|
+
enc$.encodeForm("search", payload$.search, { explode: true, charEncoding: "percent" }),
|
|
437
|
+
enc$.encodeForm("showArchived", payload$.showArchived, {
|
|
438
|
+
explode: true,
|
|
439
|
+
charEncoding: "percent",
|
|
440
|
+
}),
|
|
441
|
+
enc$.encodeForm("tagId", payload$.tagId, { explode: true, charEncoding: "percent" }),
|
|
442
|
+
enc$.encodeForm("tagIds", payload$.tagIds, { explode: true, charEncoding: "percent" }),
|
|
443
|
+
enc$.encodeForm("userId", payload$.userId, { explode: true, charEncoding: "percent" }),
|
|
444
|
+
enc$.encodeForm("withTags", payload$.withTags, {
|
|
445
|
+
explode: true,
|
|
446
|
+
charEncoding: "percent",
|
|
447
|
+
}),
|
|
448
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
449
|
+
explode: true,
|
|
450
|
+
charEncoding: "percent",
|
|
451
|
+
}),
|
|
452
|
+
]
|
|
453
|
+
.filter(Boolean)
|
|
454
|
+
.join("&");
|
|
455
|
+
let security$;
|
|
456
|
+
if (typeof this.options$.token === "function") {
|
|
457
|
+
security$ = { token: await this.options$.token() };
|
|
458
|
+
}
|
|
459
|
+
else if (this.options$.token) {
|
|
460
|
+
security$ = { token: this.options$.token };
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
security$ = {};
|
|
464
|
+
}
|
|
465
|
+
const context = {
|
|
466
|
+
operationID: "getLinksCount",
|
|
467
|
+
oAuth2Scopes: [],
|
|
468
|
+
securitySource: this.options$.token,
|
|
469
|
+
};
|
|
470
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
471
|
+
const doOptions = {
|
|
472
|
+
context,
|
|
473
|
+
errorCodes: [
|
|
474
|
+
"400",
|
|
475
|
+
"401",
|
|
476
|
+
"403",
|
|
477
|
+
"404",
|
|
478
|
+
"409",
|
|
479
|
+
"410",
|
|
480
|
+
"422",
|
|
481
|
+
"429",
|
|
482
|
+
"4XX",
|
|
483
|
+
"500",
|
|
484
|
+
"5XX",
|
|
485
|
+
],
|
|
486
|
+
};
|
|
487
|
+
const request = this.createRequest$({
|
|
488
|
+
security: securitySettings$,
|
|
489
|
+
method: "GET",
|
|
490
|
+
path: path$,
|
|
491
|
+
headers: headers$,
|
|
492
|
+
query: query$,
|
|
493
|
+
body: body$,
|
|
494
|
+
}, options);
|
|
495
|
+
const response = await this.do$(request, doOptions);
|
|
496
|
+
const responseFields$ = {
|
|
497
|
+
HttpMeta: {
|
|
498
|
+
Response: response,
|
|
499
|
+
Request: request,
|
|
500
|
+
},
|
|
501
|
+
};
|
|
502
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
503
|
+
const responseBody = await response.json();
|
|
504
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
505
|
+
return z.number().parse(val$);
|
|
506
|
+
}, "Response validation failed");
|
|
507
|
+
return result;
|
|
508
|
+
}
|
|
509
|
+
else if (this.matchResponse(response, 400, "application/json")) {
|
|
510
|
+
const responseBody = await response.json();
|
|
511
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
512
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
513
|
+
...responseFields$,
|
|
514
|
+
...val$,
|
|
515
|
+
});
|
|
516
|
+
}, "Response validation failed");
|
|
517
|
+
throw result;
|
|
518
|
+
}
|
|
519
|
+
else if (this.matchResponse(response, 401, "application/json")) {
|
|
520
|
+
const responseBody = await response.json();
|
|
521
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
522
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
523
|
+
...responseFields$,
|
|
524
|
+
...val$,
|
|
525
|
+
});
|
|
526
|
+
}, "Response validation failed");
|
|
527
|
+
throw result;
|
|
528
|
+
}
|
|
529
|
+
else if (this.matchResponse(response, 403, "application/json")) {
|
|
530
|
+
const responseBody = await response.json();
|
|
531
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
532
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
533
|
+
...responseFields$,
|
|
534
|
+
...val$,
|
|
535
|
+
});
|
|
536
|
+
}, "Response validation failed");
|
|
537
|
+
throw result;
|
|
538
|
+
}
|
|
539
|
+
else if (this.matchResponse(response, 404, "application/json")) {
|
|
540
|
+
const responseBody = await response.json();
|
|
541
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
542
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
543
|
+
...responseFields$,
|
|
544
|
+
...val$,
|
|
545
|
+
});
|
|
546
|
+
}, "Response validation failed");
|
|
547
|
+
throw result;
|
|
548
|
+
}
|
|
549
|
+
else if (this.matchResponse(response, 409, "application/json")) {
|
|
550
|
+
const responseBody = await response.json();
|
|
551
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
552
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
553
|
+
...responseFields$,
|
|
554
|
+
...val$,
|
|
555
|
+
});
|
|
556
|
+
}, "Response validation failed");
|
|
557
|
+
throw result;
|
|
558
|
+
}
|
|
559
|
+
else if (this.matchResponse(response, 410, "application/json")) {
|
|
560
|
+
const responseBody = await response.json();
|
|
561
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
562
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
563
|
+
...responseFields$,
|
|
564
|
+
...val$,
|
|
565
|
+
});
|
|
566
|
+
}, "Response validation failed");
|
|
567
|
+
throw result;
|
|
568
|
+
}
|
|
569
|
+
else if (this.matchResponse(response, 422, "application/json")) {
|
|
570
|
+
const responseBody = await response.json();
|
|
571
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
572
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
573
|
+
...responseFields$,
|
|
574
|
+
...val$,
|
|
575
|
+
});
|
|
576
|
+
}, "Response validation failed");
|
|
577
|
+
throw result;
|
|
578
|
+
}
|
|
579
|
+
else if (this.matchResponse(response, 429, "application/json")) {
|
|
580
|
+
const responseBody = await response.json();
|
|
581
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
582
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
583
|
+
...responseFields$,
|
|
584
|
+
...val$,
|
|
585
|
+
});
|
|
586
|
+
}, "Response validation failed");
|
|
587
|
+
throw result;
|
|
588
|
+
}
|
|
589
|
+
else if (this.matchResponse(response, 500, "application/json")) {
|
|
590
|
+
const responseBody = await response.json();
|
|
591
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
592
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
593
|
+
...responseFields$,
|
|
594
|
+
...val$,
|
|
595
|
+
});
|
|
596
|
+
}, "Response validation failed");
|
|
597
|
+
throw result;
|
|
598
|
+
}
|
|
599
|
+
else {
|
|
600
|
+
const responseBody = await response.text();
|
|
601
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Retrieve a link
|
|
606
|
+
*
|
|
607
|
+
* @remarks
|
|
608
|
+
* Retrieve the info for a link from their domain and key.
|
|
609
|
+
*/
|
|
610
|
+
async get(input, options) {
|
|
611
|
+
const headers$ = new Headers();
|
|
612
|
+
headers$.set("user-agent", config_1.SDK_METADATA.userAgent);
|
|
613
|
+
headers$.set("Accept", "application/json");
|
|
614
|
+
const payload$ = schemas$.parse(input, (value$) => operations.GetLinkInfoRequest$.outboundSchema.parse(value$), "Input validation failed");
|
|
615
|
+
const body$ = null;
|
|
616
|
+
const path$ = this.templateURLComponent("/links/info")();
|
|
617
|
+
const query$ = [
|
|
618
|
+
enc$.encodeForm("domain", payload$.domain, { explode: true, charEncoding: "percent" }),
|
|
619
|
+
enc$.encodeForm("key", payload$.key, { explode: true, charEncoding: "percent" }),
|
|
620
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
621
|
+
explode: true,
|
|
622
|
+
charEncoding: "percent",
|
|
623
|
+
}),
|
|
624
|
+
]
|
|
625
|
+
.filter(Boolean)
|
|
626
|
+
.join("&");
|
|
627
|
+
let security$;
|
|
628
|
+
if (typeof this.options$.token === "function") {
|
|
629
|
+
security$ = { token: await this.options$.token() };
|
|
630
|
+
}
|
|
631
|
+
else if (this.options$.token) {
|
|
632
|
+
security$ = { token: this.options$.token };
|
|
633
|
+
}
|
|
634
|
+
else {
|
|
635
|
+
security$ = {};
|
|
636
|
+
}
|
|
637
|
+
const context = {
|
|
638
|
+
operationID: "getLinkInfo",
|
|
639
|
+
oAuth2Scopes: [],
|
|
640
|
+
securitySource: this.options$.token,
|
|
641
|
+
};
|
|
642
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
643
|
+
const doOptions = {
|
|
644
|
+
context,
|
|
645
|
+
errorCodes: [
|
|
646
|
+
"400",
|
|
647
|
+
"401",
|
|
648
|
+
"403",
|
|
649
|
+
"404",
|
|
650
|
+
"409",
|
|
651
|
+
"410",
|
|
652
|
+
"422",
|
|
653
|
+
"429",
|
|
654
|
+
"4XX",
|
|
655
|
+
"500",
|
|
656
|
+
"5XX",
|
|
657
|
+
],
|
|
658
|
+
};
|
|
659
|
+
const request = this.createRequest$({
|
|
660
|
+
security: securitySettings$,
|
|
661
|
+
method: "GET",
|
|
662
|
+
path: path$,
|
|
663
|
+
headers: headers$,
|
|
664
|
+
query: query$,
|
|
665
|
+
body: body$,
|
|
666
|
+
}, options);
|
|
667
|
+
const response = await this.do$(request, doOptions);
|
|
668
|
+
const responseFields$ = {
|
|
669
|
+
HttpMeta: {
|
|
670
|
+
Response: response,
|
|
671
|
+
Request: request,
|
|
672
|
+
},
|
|
673
|
+
};
|
|
674
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
675
|
+
const responseBody = await response.json();
|
|
676
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
677
|
+
return components.LinkSchema$.inboundSchema.parse(val$);
|
|
678
|
+
}, "Response validation failed");
|
|
679
|
+
return result;
|
|
680
|
+
}
|
|
681
|
+
else if (this.matchResponse(response, 400, "application/json")) {
|
|
682
|
+
const responseBody = await response.json();
|
|
683
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
684
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
685
|
+
...responseFields$,
|
|
686
|
+
...val$,
|
|
687
|
+
});
|
|
688
|
+
}, "Response validation failed");
|
|
689
|
+
throw result;
|
|
690
|
+
}
|
|
691
|
+
else if (this.matchResponse(response, 401, "application/json")) {
|
|
692
|
+
const responseBody = await response.json();
|
|
693
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
694
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
695
|
+
...responseFields$,
|
|
696
|
+
...val$,
|
|
697
|
+
});
|
|
698
|
+
}, "Response validation failed");
|
|
699
|
+
throw result;
|
|
700
|
+
}
|
|
701
|
+
else if (this.matchResponse(response, 403, "application/json")) {
|
|
702
|
+
const responseBody = await response.json();
|
|
703
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
704
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
705
|
+
...responseFields$,
|
|
706
|
+
...val$,
|
|
707
|
+
});
|
|
708
|
+
}, "Response validation failed");
|
|
709
|
+
throw result;
|
|
710
|
+
}
|
|
711
|
+
else if (this.matchResponse(response, 404, "application/json")) {
|
|
712
|
+
const responseBody = await response.json();
|
|
713
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
714
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
715
|
+
...responseFields$,
|
|
716
|
+
...val$,
|
|
717
|
+
});
|
|
718
|
+
}, "Response validation failed");
|
|
719
|
+
throw result;
|
|
720
|
+
}
|
|
721
|
+
else if (this.matchResponse(response, 409, "application/json")) {
|
|
722
|
+
const responseBody = await response.json();
|
|
723
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
724
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
725
|
+
...responseFields$,
|
|
726
|
+
...val$,
|
|
727
|
+
});
|
|
728
|
+
}, "Response validation failed");
|
|
729
|
+
throw result;
|
|
730
|
+
}
|
|
731
|
+
else if (this.matchResponse(response, 410, "application/json")) {
|
|
732
|
+
const responseBody = await response.json();
|
|
733
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
734
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
735
|
+
...responseFields$,
|
|
736
|
+
...val$,
|
|
737
|
+
});
|
|
738
|
+
}, "Response validation failed");
|
|
739
|
+
throw result;
|
|
740
|
+
}
|
|
741
|
+
else if (this.matchResponse(response, 422, "application/json")) {
|
|
742
|
+
const responseBody = await response.json();
|
|
743
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
744
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
745
|
+
...responseFields$,
|
|
746
|
+
...val$,
|
|
747
|
+
});
|
|
748
|
+
}, "Response validation failed");
|
|
749
|
+
throw result;
|
|
750
|
+
}
|
|
751
|
+
else if (this.matchResponse(response, 429, "application/json")) {
|
|
752
|
+
const responseBody = await response.json();
|
|
753
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
754
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
755
|
+
...responseFields$,
|
|
756
|
+
...val$,
|
|
757
|
+
});
|
|
758
|
+
}, "Response validation failed");
|
|
759
|
+
throw result;
|
|
760
|
+
}
|
|
761
|
+
else if (this.matchResponse(response, 500, "application/json")) {
|
|
762
|
+
const responseBody = await response.json();
|
|
763
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
764
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
765
|
+
...responseFields$,
|
|
766
|
+
...val$,
|
|
767
|
+
});
|
|
768
|
+
}, "Response validation failed");
|
|
769
|
+
throw result;
|
|
770
|
+
}
|
|
771
|
+
else {
|
|
772
|
+
const responseBody = await response.text();
|
|
773
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Edit a link
|
|
778
|
+
*
|
|
779
|
+
* @remarks
|
|
780
|
+
* Edit a link for the authenticated workspace.
|
|
781
|
+
*/
|
|
782
|
+
async update(linkId, requestBody, options) {
|
|
783
|
+
const input$ = {
|
|
784
|
+
linkId: linkId,
|
|
785
|
+
requestBody: requestBody,
|
|
786
|
+
};
|
|
787
|
+
const headers$ = new Headers();
|
|
788
|
+
headers$.set("user-agent", config_1.SDK_METADATA.userAgent);
|
|
789
|
+
headers$.set("Content-Type", "application/json");
|
|
790
|
+
headers$.set("Accept", "application/json");
|
|
791
|
+
const payload$ = schemas$.parse(input$, (value$) => operations.EditLinkRequest$.outboundSchema.parse(value$), "Input validation failed");
|
|
792
|
+
const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true });
|
|
793
|
+
const pathParams$ = {
|
|
794
|
+
linkId: enc$.encodeSimple("linkId", payload$.linkId, {
|
|
795
|
+
explode: false,
|
|
796
|
+
charEncoding: "percent",
|
|
797
|
+
}),
|
|
798
|
+
};
|
|
799
|
+
const path$ = this.templateURLComponent("/links/{linkId}")(pathParams$);
|
|
800
|
+
const query$ = [
|
|
801
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
802
|
+
explode: true,
|
|
803
|
+
charEncoding: "percent",
|
|
804
|
+
}),
|
|
805
|
+
]
|
|
806
|
+
.filter(Boolean)
|
|
807
|
+
.join("&");
|
|
808
|
+
let security$;
|
|
809
|
+
if (typeof this.options$.token === "function") {
|
|
810
|
+
security$ = { token: await this.options$.token() };
|
|
811
|
+
}
|
|
812
|
+
else if (this.options$.token) {
|
|
813
|
+
security$ = { token: this.options$.token };
|
|
814
|
+
}
|
|
815
|
+
else {
|
|
816
|
+
security$ = {};
|
|
817
|
+
}
|
|
818
|
+
const context = {
|
|
819
|
+
operationID: "editLink",
|
|
820
|
+
oAuth2Scopes: [],
|
|
821
|
+
securitySource: this.options$.token,
|
|
822
|
+
};
|
|
823
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
824
|
+
const doOptions = {
|
|
825
|
+
context,
|
|
826
|
+
errorCodes: [
|
|
827
|
+
"400",
|
|
828
|
+
"401",
|
|
829
|
+
"403",
|
|
830
|
+
"404",
|
|
831
|
+
"409",
|
|
832
|
+
"410",
|
|
833
|
+
"422",
|
|
834
|
+
"429",
|
|
835
|
+
"4XX",
|
|
836
|
+
"500",
|
|
837
|
+
"5XX",
|
|
838
|
+
],
|
|
839
|
+
};
|
|
840
|
+
const request = this.createRequest$({
|
|
841
|
+
security: securitySettings$,
|
|
842
|
+
method: "PUT",
|
|
843
|
+
path: path$,
|
|
844
|
+
headers: headers$,
|
|
845
|
+
query: query$,
|
|
846
|
+
body: body$,
|
|
847
|
+
}, options);
|
|
848
|
+
const response = await this.do$(request, doOptions);
|
|
849
|
+
const responseFields$ = {
|
|
850
|
+
HttpMeta: {
|
|
851
|
+
Response: response,
|
|
852
|
+
Request: request,
|
|
853
|
+
},
|
|
854
|
+
};
|
|
855
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
856
|
+
const responseBody = await response.json();
|
|
857
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
858
|
+
return components.LinkSchema$.inboundSchema.parse(val$);
|
|
859
|
+
}, "Response validation failed");
|
|
860
|
+
return result;
|
|
861
|
+
}
|
|
862
|
+
else if (this.matchResponse(response, 400, "application/json")) {
|
|
863
|
+
const responseBody = await response.json();
|
|
864
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
865
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
866
|
+
...responseFields$,
|
|
867
|
+
...val$,
|
|
868
|
+
});
|
|
869
|
+
}, "Response validation failed");
|
|
870
|
+
throw result;
|
|
871
|
+
}
|
|
872
|
+
else if (this.matchResponse(response, 401, "application/json")) {
|
|
873
|
+
const responseBody = await response.json();
|
|
874
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
875
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
876
|
+
...responseFields$,
|
|
877
|
+
...val$,
|
|
878
|
+
});
|
|
879
|
+
}, "Response validation failed");
|
|
880
|
+
throw result;
|
|
881
|
+
}
|
|
882
|
+
else if (this.matchResponse(response, 403, "application/json")) {
|
|
883
|
+
const responseBody = await response.json();
|
|
884
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
885
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
886
|
+
...responseFields$,
|
|
887
|
+
...val$,
|
|
888
|
+
});
|
|
889
|
+
}, "Response validation failed");
|
|
890
|
+
throw result;
|
|
891
|
+
}
|
|
892
|
+
else if (this.matchResponse(response, 404, "application/json")) {
|
|
893
|
+
const responseBody = await response.json();
|
|
894
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
895
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
896
|
+
...responseFields$,
|
|
897
|
+
...val$,
|
|
898
|
+
});
|
|
899
|
+
}, "Response validation failed");
|
|
900
|
+
throw result;
|
|
901
|
+
}
|
|
902
|
+
else if (this.matchResponse(response, 409, "application/json")) {
|
|
903
|
+
const responseBody = await response.json();
|
|
904
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
905
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
906
|
+
...responseFields$,
|
|
907
|
+
...val$,
|
|
908
|
+
});
|
|
909
|
+
}, "Response validation failed");
|
|
910
|
+
throw result;
|
|
911
|
+
}
|
|
912
|
+
else if (this.matchResponse(response, 410, "application/json")) {
|
|
913
|
+
const responseBody = await response.json();
|
|
914
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
915
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
916
|
+
...responseFields$,
|
|
917
|
+
...val$,
|
|
918
|
+
});
|
|
919
|
+
}, "Response validation failed");
|
|
920
|
+
throw result;
|
|
921
|
+
}
|
|
922
|
+
else if (this.matchResponse(response, 422, "application/json")) {
|
|
923
|
+
const responseBody = await response.json();
|
|
924
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
925
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
926
|
+
...responseFields$,
|
|
927
|
+
...val$,
|
|
928
|
+
});
|
|
929
|
+
}, "Response validation failed");
|
|
930
|
+
throw result;
|
|
931
|
+
}
|
|
932
|
+
else if (this.matchResponse(response, 429, "application/json")) {
|
|
933
|
+
const responseBody = await response.json();
|
|
934
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
935
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
936
|
+
...responseFields$,
|
|
937
|
+
...val$,
|
|
938
|
+
});
|
|
939
|
+
}, "Response validation failed");
|
|
940
|
+
throw result;
|
|
941
|
+
}
|
|
942
|
+
else if (this.matchResponse(response, 500, "application/json")) {
|
|
943
|
+
const responseBody = await response.json();
|
|
944
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
945
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
946
|
+
...responseFields$,
|
|
947
|
+
...val$,
|
|
948
|
+
});
|
|
949
|
+
}, "Response validation failed");
|
|
950
|
+
throw result;
|
|
951
|
+
}
|
|
952
|
+
else {
|
|
953
|
+
const responseBody = await response.text();
|
|
954
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Delete a link
|
|
959
|
+
*
|
|
960
|
+
* @remarks
|
|
961
|
+
* Delete a link for the authenticated workspace.
|
|
962
|
+
*/
|
|
963
|
+
async delete(linkId, options) {
|
|
964
|
+
const input$ = {
|
|
965
|
+
linkId: linkId,
|
|
966
|
+
};
|
|
967
|
+
const headers$ = new Headers();
|
|
968
|
+
headers$.set("user-agent", config_1.SDK_METADATA.userAgent);
|
|
969
|
+
headers$.set("Accept", "application/json");
|
|
970
|
+
const payload$ = schemas$.parse(input$, (value$) => operations.DeleteLinkRequest$.outboundSchema.parse(value$), "Input validation failed");
|
|
971
|
+
const body$ = null;
|
|
972
|
+
const pathParams$ = {
|
|
973
|
+
linkId: enc$.encodeSimple("linkId", payload$.linkId, {
|
|
974
|
+
explode: false,
|
|
975
|
+
charEncoding: "percent",
|
|
976
|
+
}),
|
|
977
|
+
};
|
|
978
|
+
const path$ = this.templateURLComponent("/links/{linkId}")(pathParams$);
|
|
979
|
+
const query$ = [
|
|
980
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
981
|
+
explode: true,
|
|
982
|
+
charEncoding: "percent",
|
|
983
|
+
}),
|
|
984
|
+
]
|
|
985
|
+
.filter(Boolean)
|
|
986
|
+
.join("&");
|
|
987
|
+
let security$;
|
|
988
|
+
if (typeof this.options$.token === "function") {
|
|
989
|
+
security$ = { token: await this.options$.token() };
|
|
990
|
+
}
|
|
991
|
+
else if (this.options$.token) {
|
|
992
|
+
security$ = { token: this.options$.token };
|
|
993
|
+
}
|
|
994
|
+
else {
|
|
995
|
+
security$ = {};
|
|
996
|
+
}
|
|
997
|
+
const context = {
|
|
998
|
+
operationID: "deleteLink",
|
|
999
|
+
oAuth2Scopes: [],
|
|
1000
|
+
securitySource: this.options$.token,
|
|
1001
|
+
};
|
|
1002
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
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
|
+
security: securitySettings$,
|
|
1021
|
+
method: "DELETE",
|
|
1022
|
+
path: path$,
|
|
1023
|
+
headers: headers$,
|
|
1024
|
+
query: query$,
|
|
1025
|
+
body: body$,
|
|
1026
|
+
}, options);
|
|
1027
|
+
const response = await this.do$(request, doOptions);
|
|
1028
|
+
const responseFields$ = {
|
|
1029
|
+
HttpMeta: {
|
|
1030
|
+
Response: response,
|
|
1031
|
+
Request: request,
|
|
1032
|
+
},
|
|
1033
|
+
};
|
|
1034
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
1035
|
+
const responseBody = await response.json();
|
|
1036
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1037
|
+
return operations.DeleteLinkResponseBody$.inboundSchema.parse(val$);
|
|
1038
|
+
}, "Response validation failed");
|
|
1039
|
+
return result;
|
|
1040
|
+
}
|
|
1041
|
+
else if (this.matchResponse(response, 400, "application/json")) {
|
|
1042
|
+
const responseBody = await response.json();
|
|
1043
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1044
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
1045
|
+
...responseFields$,
|
|
1046
|
+
...val$,
|
|
1047
|
+
});
|
|
1048
|
+
}, "Response validation failed");
|
|
1049
|
+
throw result;
|
|
1050
|
+
}
|
|
1051
|
+
else if (this.matchResponse(response, 401, "application/json")) {
|
|
1052
|
+
const responseBody = await response.json();
|
|
1053
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1054
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
1055
|
+
...responseFields$,
|
|
1056
|
+
...val$,
|
|
1057
|
+
});
|
|
1058
|
+
}, "Response validation failed");
|
|
1059
|
+
throw result;
|
|
1060
|
+
}
|
|
1061
|
+
else if (this.matchResponse(response, 403, "application/json")) {
|
|
1062
|
+
const responseBody = await response.json();
|
|
1063
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1064
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
1065
|
+
...responseFields$,
|
|
1066
|
+
...val$,
|
|
1067
|
+
});
|
|
1068
|
+
}, "Response validation failed");
|
|
1069
|
+
throw result;
|
|
1070
|
+
}
|
|
1071
|
+
else if (this.matchResponse(response, 404, "application/json")) {
|
|
1072
|
+
const responseBody = await response.json();
|
|
1073
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1074
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
1075
|
+
...responseFields$,
|
|
1076
|
+
...val$,
|
|
1077
|
+
});
|
|
1078
|
+
}, "Response validation failed");
|
|
1079
|
+
throw result;
|
|
1080
|
+
}
|
|
1081
|
+
else if (this.matchResponse(response, 409, "application/json")) {
|
|
1082
|
+
const responseBody = await response.json();
|
|
1083
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1084
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
1085
|
+
...responseFields$,
|
|
1086
|
+
...val$,
|
|
1087
|
+
});
|
|
1088
|
+
}, "Response validation failed");
|
|
1089
|
+
throw result;
|
|
1090
|
+
}
|
|
1091
|
+
else if (this.matchResponse(response, 410, "application/json")) {
|
|
1092
|
+
const responseBody = await response.json();
|
|
1093
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1094
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
1095
|
+
...responseFields$,
|
|
1096
|
+
...val$,
|
|
1097
|
+
});
|
|
1098
|
+
}, "Response validation failed");
|
|
1099
|
+
throw result;
|
|
1100
|
+
}
|
|
1101
|
+
else if (this.matchResponse(response, 422, "application/json")) {
|
|
1102
|
+
const responseBody = await response.json();
|
|
1103
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1104
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
1105
|
+
...responseFields$,
|
|
1106
|
+
...val$,
|
|
1107
|
+
});
|
|
1108
|
+
}, "Response validation failed");
|
|
1109
|
+
throw result;
|
|
1110
|
+
}
|
|
1111
|
+
else if (this.matchResponse(response, 429, "application/json")) {
|
|
1112
|
+
const responseBody = await response.json();
|
|
1113
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1114
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
1115
|
+
...responseFields$,
|
|
1116
|
+
...val$,
|
|
1117
|
+
});
|
|
1118
|
+
}, "Response validation failed");
|
|
1119
|
+
throw result;
|
|
1120
|
+
}
|
|
1121
|
+
else if (this.matchResponse(response, 500, "application/json")) {
|
|
1122
|
+
const responseBody = await response.json();
|
|
1123
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1124
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
1125
|
+
...responseFields$,
|
|
1126
|
+
...val$,
|
|
1127
|
+
});
|
|
1128
|
+
}, "Response validation failed");
|
|
1129
|
+
throw result;
|
|
1130
|
+
}
|
|
1131
|
+
else {
|
|
1132
|
+
const responseBody = await response.text();
|
|
1133
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Bulk create links
|
|
1138
|
+
*
|
|
1139
|
+
* @remarks
|
|
1140
|
+
* Bulk create up to 100 links for the authenticated workspace.
|
|
1141
|
+
*/
|
|
1142
|
+
async createMany(input, options) {
|
|
1143
|
+
const headers$ = new Headers();
|
|
1144
|
+
headers$.set("user-agent", config_1.SDK_METADATA.userAgent);
|
|
1145
|
+
headers$.set("Content-Type", "application/json");
|
|
1146
|
+
headers$.set("Accept", "application/json");
|
|
1147
|
+
const payload$ = schemas$.parse(input, (value$) => z.array(operations.RequestBody$.outboundSchema).optional().parse(value$), "Input validation failed");
|
|
1148
|
+
const body$ = payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true });
|
|
1149
|
+
const path$ = this.templateURLComponent("/links/bulk")();
|
|
1150
|
+
const query$ = [
|
|
1151
|
+
enc$.encodeForm("workspaceId", this.options$.workspaceId, {
|
|
1152
|
+
explode: true,
|
|
1153
|
+
charEncoding: "percent",
|
|
1154
|
+
}),
|
|
1155
|
+
]
|
|
1156
|
+
.filter(Boolean)
|
|
1157
|
+
.join("&");
|
|
1158
|
+
let security$;
|
|
1159
|
+
if (typeof this.options$.token === "function") {
|
|
1160
|
+
security$ = { token: await this.options$.token() };
|
|
1161
|
+
}
|
|
1162
|
+
else if (this.options$.token) {
|
|
1163
|
+
security$ = { token: this.options$.token };
|
|
1164
|
+
}
|
|
1165
|
+
else {
|
|
1166
|
+
security$ = {};
|
|
1167
|
+
}
|
|
1168
|
+
const context = {
|
|
1169
|
+
operationID: "bulkCreateLinks",
|
|
1170
|
+
oAuth2Scopes: [],
|
|
1171
|
+
securitySource: this.options$.token,
|
|
1172
|
+
};
|
|
1173
|
+
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
1174
|
+
const doOptions = {
|
|
1175
|
+
context,
|
|
1176
|
+
errorCodes: [
|
|
1177
|
+
"400",
|
|
1178
|
+
"401",
|
|
1179
|
+
"403",
|
|
1180
|
+
"404",
|
|
1181
|
+
"409",
|
|
1182
|
+
"410",
|
|
1183
|
+
"422",
|
|
1184
|
+
"429",
|
|
1185
|
+
"4XX",
|
|
1186
|
+
"500",
|
|
1187
|
+
"5XX",
|
|
1188
|
+
],
|
|
1189
|
+
};
|
|
1190
|
+
const request = this.createRequest$({
|
|
1191
|
+
security: securitySettings$,
|
|
1192
|
+
method: "POST",
|
|
1193
|
+
path: path$,
|
|
1194
|
+
headers: headers$,
|
|
1195
|
+
query: query$,
|
|
1196
|
+
body: body$,
|
|
1197
|
+
}, options);
|
|
1198
|
+
const response = await this.do$(request, doOptions);
|
|
1199
|
+
const responseFields$ = {
|
|
1200
|
+
HttpMeta: {
|
|
1201
|
+
Response: response,
|
|
1202
|
+
Request: request,
|
|
1203
|
+
},
|
|
1204
|
+
};
|
|
1205
|
+
if (this.matchResponse(response, 200, "application/json")) {
|
|
1206
|
+
const responseBody = await response.json();
|
|
1207
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1208
|
+
return z.array(components.LinkSchema$.inboundSchema).parse(val$);
|
|
1209
|
+
}, "Response validation failed");
|
|
1210
|
+
return result;
|
|
1211
|
+
}
|
|
1212
|
+
else if (this.matchResponse(response, 400, "application/json")) {
|
|
1213
|
+
const responseBody = await response.json();
|
|
1214
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1215
|
+
return errors.BadRequest$.inboundSchema.parse({
|
|
1216
|
+
...responseFields$,
|
|
1217
|
+
...val$,
|
|
1218
|
+
});
|
|
1219
|
+
}, "Response validation failed");
|
|
1220
|
+
throw result;
|
|
1221
|
+
}
|
|
1222
|
+
else if (this.matchResponse(response, 401, "application/json")) {
|
|
1223
|
+
const responseBody = await response.json();
|
|
1224
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1225
|
+
return errors.Unauthorized$.inboundSchema.parse({
|
|
1226
|
+
...responseFields$,
|
|
1227
|
+
...val$,
|
|
1228
|
+
});
|
|
1229
|
+
}, "Response validation failed");
|
|
1230
|
+
throw result;
|
|
1231
|
+
}
|
|
1232
|
+
else if (this.matchResponse(response, 403, "application/json")) {
|
|
1233
|
+
const responseBody = await response.json();
|
|
1234
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1235
|
+
return errors.Forbidden$.inboundSchema.parse({
|
|
1236
|
+
...responseFields$,
|
|
1237
|
+
...val$,
|
|
1238
|
+
});
|
|
1239
|
+
}, "Response validation failed");
|
|
1240
|
+
throw result;
|
|
1241
|
+
}
|
|
1242
|
+
else if (this.matchResponse(response, 404, "application/json")) {
|
|
1243
|
+
const responseBody = await response.json();
|
|
1244
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1245
|
+
return errors.NotFound$.inboundSchema.parse({
|
|
1246
|
+
...responseFields$,
|
|
1247
|
+
...val$,
|
|
1248
|
+
});
|
|
1249
|
+
}, "Response validation failed");
|
|
1250
|
+
throw result;
|
|
1251
|
+
}
|
|
1252
|
+
else if (this.matchResponse(response, 409, "application/json")) {
|
|
1253
|
+
const responseBody = await response.json();
|
|
1254
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1255
|
+
return errors.Conflict$.inboundSchema.parse({
|
|
1256
|
+
...responseFields$,
|
|
1257
|
+
...val$,
|
|
1258
|
+
});
|
|
1259
|
+
}, "Response validation failed");
|
|
1260
|
+
throw result;
|
|
1261
|
+
}
|
|
1262
|
+
else if (this.matchResponse(response, 410, "application/json")) {
|
|
1263
|
+
const responseBody = await response.json();
|
|
1264
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1265
|
+
return errors.InviteExpired$.inboundSchema.parse({
|
|
1266
|
+
...responseFields$,
|
|
1267
|
+
...val$,
|
|
1268
|
+
});
|
|
1269
|
+
}, "Response validation failed");
|
|
1270
|
+
throw result;
|
|
1271
|
+
}
|
|
1272
|
+
else if (this.matchResponse(response, 422, "application/json")) {
|
|
1273
|
+
const responseBody = await response.json();
|
|
1274
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1275
|
+
return errors.UnprocessableEntity$.inboundSchema.parse({
|
|
1276
|
+
...responseFields$,
|
|
1277
|
+
...val$,
|
|
1278
|
+
});
|
|
1279
|
+
}, "Response validation failed");
|
|
1280
|
+
throw result;
|
|
1281
|
+
}
|
|
1282
|
+
else if (this.matchResponse(response, 429, "application/json")) {
|
|
1283
|
+
const responseBody = await response.json();
|
|
1284
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1285
|
+
return errors.RateLimitExceeded$.inboundSchema.parse({
|
|
1286
|
+
...responseFields$,
|
|
1287
|
+
...val$,
|
|
1288
|
+
});
|
|
1289
|
+
}, "Response validation failed");
|
|
1290
|
+
throw result;
|
|
1291
|
+
}
|
|
1292
|
+
else if (this.matchResponse(response, 500, "application/json")) {
|
|
1293
|
+
const responseBody = await response.json();
|
|
1294
|
+
const result = schemas$.parse(responseBody, (val$) => {
|
|
1295
|
+
return errors.InternalServerError$.inboundSchema.parse({
|
|
1296
|
+
...responseFields$,
|
|
1297
|
+
...val$,
|
|
1298
|
+
});
|
|
1299
|
+
}, "Response validation failed");
|
|
1300
|
+
throw result;
|
|
1301
|
+
}
|
|
1302
|
+
else {
|
|
1303
|
+
const responseBody = await response.text();
|
|
1304
|
+
throw new errors.SDKError("Unexpected API response", response, responseBody);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
exports.Links = Links;
|
|
1309
|
+
//# sourceMappingURL=links.js.map
|