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/README.md
CHANGED
|
@@ -1,251 +1,361 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dub
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="left">
|
|
4
|
+
<a href="https://speakeasyapi.dev/"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
|
|
5
|
+
<a href="https://opensource.org/licenses/MIT">
|
|
6
|
+
<img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" />
|
|
7
|
+
</a>
|
|
8
|
+
</div>
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
<!-- Start SDK Installation [installation] -->
|
|
11
|
+
## SDK Installation
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
### NPM
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
```bash
|
|
16
|
+
npm add dub
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Yarn
|
|
10
20
|
|
|
11
|
-
```
|
|
12
|
-
|
|
21
|
+
```bash
|
|
22
|
+
yarn add dub
|
|
13
23
|
```
|
|
24
|
+
<!-- End SDK Installation [installation] -->
|
|
25
|
+
|
|
26
|
+
<!-- Start Requirements [requirements] -->
|
|
27
|
+
## Requirements
|
|
28
|
+
|
|
29
|
+
For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
|
|
30
|
+
<!-- End Requirements [requirements] -->
|
|
14
31
|
|
|
15
|
-
|
|
32
|
+
<!-- Start SDK Example Usage [usage] -->
|
|
33
|
+
## SDK Example Usage
|
|
16
34
|
|
|
17
|
-
|
|
35
|
+
### Example
|
|
18
36
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import Dub from 'dub';
|
|
37
|
+
```typescript
|
|
38
|
+
import { Dub } from "dub";
|
|
22
39
|
|
|
23
|
-
|
|
40
|
+
async function run() {
|
|
41
|
+
const sdk = new Dub({
|
|
42
|
+
token: "<YOUR_BEARER_TOKEN_HERE>",
|
|
43
|
+
workspaceId: "<value>",
|
|
44
|
+
projectSlug: "<value>",
|
|
45
|
+
});
|
|
24
46
|
|
|
25
|
-
|
|
26
|
-
|
|
47
|
+
const result = await sdk.links.list({
|
|
48
|
+
tagIds: ["<value>"],
|
|
49
|
+
});
|
|
27
50
|
|
|
28
|
-
|
|
51
|
+
// Handle the result
|
|
52
|
+
console.log(result);
|
|
29
53
|
}
|
|
30
54
|
|
|
31
|
-
|
|
55
|
+
run();
|
|
56
|
+
|
|
32
57
|
```
|
|
58
|
+
<!-- End SDK Example Usage [usage] -->
|
|
33
59
|
|
|
34
|
-
|
|
60
|
+
<!-- Start Available Resources and Operations [operations] -->
|
|
61
|
+
## Available Resources and Operations
|
|
35
62
|
|
|
36
|
-
|
|
63
|
+
### [links](docs/sdks/links/README.md)
|
|
37
64
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
65
|
+
* [list](docs/sdks/links/README.md#list) - Retrieve a list of links
|
|
66
|
+
* [create](docs/sdks/links/README.md#create) - Create a new link
|
|
67
|
+
* [count](docs/sdks/links/README.md#count) - Retrieve the number of links
|
|
68
|
+
* [get](docs/sdks/links/README.md#get) - Retrieve a link
|
|
69
|
+
* [update](docs/sdks/links/README.md#update) - Edit a link
|
|
70
|
+
* [delete](docs/sdks/links/README.md#delete) - Delete a link
|
|
71
|
+
* [createMany](docs/sdks/links/README.md#createmany) - Bulk create links
|
|
41
72
|
|
|
42
|
-
|
|
73
|
+
### [qrCodes](docs/sdks/qrcodes/README.md)
|
|
43
74
|
|
|
44
|
-
|
|
45
|
-
const params: Dub.ProjectRetrieveParams = { projectSlug: 'REPLACE_ME' };
|
|
46
|
-
const projectRetrieveResponse: Dub.ProjectRetrieveResponse = await dub.projects.retrieve(params);
|
|
47
|
-
}
|
|
75
|
+
* [get](docs/sdks/qrcodes/README.md#get) - Retrieve a QR code
|
|
48
76
|
|
|
49
|
-
|
|
50
|
-
|
|
77
|
+
### [analytics](docs/sdks/analytics/README.md)
|
|
78
|
+
|
|
79
|
+
* [clicks](docs/sdks/analytics/README.md#clicks) - Retrieve clicks analytics
|
|
80
|
+
* [timeseries](docs/sdks/analytics/README.md#timeseries) - Retrieve timeseries analytics
|
|
81
|
+
* [countries](docs/sdks/analytics/README.md#countries) - Retrieve country analytics
|
|
82
|
+
* [cities](docs/sdks/analytics/README.md#cities) - Retrieve city analytics
|
|
83
|
+
* [devices](docs/sdks/analytics/README.md#devices) - Retrieve device analytics
|
|
84
|
+
* [browsers](docs/sdks/analytics/README.md#browsers) - Retrieve browser analytics
|
|
85
|
+
* [os](docs/sdks/analytics/README.md#os) - Retrieve OS analytics
|
|
86
|
+
* [referers](docs/sdks/analytics/README.md#referers) - Retrieve referer analytics
|
|
87
|
+
* [topLinks](docs/sdks/analytics/README.md#toplinks) - Retrieve top links
|
|
88
|
+
* [topUrls](docs/sdks/analytics/README.md#topurls) - Retrieve top URLs
|
|
89
|
+
|
|
90
|
+
### [workspaces](docs/sdks/workspaces/README.md)
|
|
51
91
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<!--
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
92
|
+
* [list](docs/sdks/workspaces/README.md#list) - Retrieve a list of workspaces
|
|
93
|
+
* [create](docs/sdks/workspaces/README.md#create) - Create a workspace
|
|
94
|
+
* [get](docs/sdks/workspaces/README.md#get) - Retrieve a workspace
|
|
95
|
+
|
|
96
|
+
### [tags](docs/sdks/tags/README.md)
|
|
97
|
+
|
|
98
|
+
* [list](docs/sdks/tags/README.md#list) - Retrieve a list of tags
|
|
99
|
+
* [create](docs/sdks/tags/README.md#create) - Create a new tag
|
|
100
|
+
<!-- End Available Resources and Operations [operations] -->
|
|
101
|
+
|
|
102
|
+
<!-- Start Error Handling [errors] -->
|
|
103
|
+
## Error Handling
|
|
104
|
+
|
|
105
|
+
All SDK methods return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.
|
|
106
|
+
|
|
107
|
+
| Error Object | Status Code | Content Type |
|
|
108
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
109
|
+
| errors.BadRequest | 400 | application/json |
|
|
110
|
+
| errors.Unauthorized | 401 | application/json |
|
|
111
|
+
| errors.Forbidden | 403 | application/json |
|
|
112
|
+
| errors.NotFound | 404 | application/json |
|
|
113
|
+
| errors.Conflict | 409 | application/json |
|
|
114
|
+
| errors.InviteExpired | 410 | application/json |
|
|
115
|
+
| errors.UnprocessableEntity | 422 | application/json |
|
|
116
|
+
| errors.RateLimitExceeded | 429 | application/json |
|
|
117
|
+
| errors.InternalServerError | 500 | application/json |
|
|
118
|
+
| errors.SDKError | 4xx-5xx | */* |
|
|
119
|
+
|
|
120
|
+
Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging.
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
import { Dub } from "dub";
|
|
125
|
+
import * as errors from "dub/models/errors";
|
|
126
|
+
|
|
127
|
+
async function run() {
|
|
128
|
+
const sdk = new Dub({
|
|
129
|
+
token: "<YOUR_BEARER_TOKEN_HERE>",
|
|
130
|
+
workspaceId: "<value>",
|
|
131
|
+
projectSlug: "<value>",
|
|
73
132
|
});
|
|
133
|
+
|
|
134
|
+
let result;
|
|
135
|
+
try {
|
|
136
|
+
result = await sdk.links.list({
|
|
137
|
+
tagIds: ["<value>"],
|
|
138
|
+
});
|
|
139
|
+
} catch (err) {
|
|
140
|
+
switch (true) {
|
|
141
|
+
case err instanceof errors.SDKValidationError: {
|
|
142
|
+
// Validation errors can be pretty-printed
|
|
143
|
+
console.error(err.pretty());
|
|
144
|
+
// Raw value may also be inspected
|
|
145
|
+
console.error(err.rawValue);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
case err instanceof errors.BadRequest: {
|
|
149
|
+
console.error(err); // handle exception
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
case err instanceof errors.Unauthorized: {
|
|
153
|
+
console.error(err); // handle exception
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
case err instanceof errors.Forbidden: {
|
|
157
|
+
console.error(err); // handle exception
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
case err instanceof errors.NotFound: {
|
|
161
|
+
console.error(err); // handle exception
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
case err instanceof errors.Conflict: {
|
|
165
|
+
console.error(err); // handle exception
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
case err instanceof errors.InviteExpired: {
|
|
169
|
+
console.error(err); // handle exception
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
case err instanceof errors.UnprocessableEntity: {
|
|
173
|
+
console.error(err); // handle exception
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
case err instanceof errors.RateLimitExceeded: {
|
|
177
|
+
console.error(err); // handle exception
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
case err instanceof errors.InternalServerError: {
|
|
181
|
+
console.error(err); // handle exception
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
default: {
|
|
185
|
+
throw err;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Handle the result
|
|
191
|
+
console.log(result);
|
|
74
192
|
}
|
|
75
193
|
|
|
76
|
-
|
|
194
|
+
run();
|
|
195
|
+
|
|
77
196
|
```
|
|
197
|
+
<!-- End Error Handling [errors] -->
|
|
78
198
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
| Status Code | Error Type |
|
|
82
|
-
| ----------- | -------------------------- |
|
|
83
|
-
| 400 | `BadRequestError` |
|
|
84
|
-
| 401 | `AuthenticationError` |
|
|
85
|
-
| 403 | `PermissionDeniedError` |
|
|
86
|
-
| 404 | `NotFoundError` |
|
|
87
|
-
| 422 | `UnprocessableEntityError` |
|
|
88
|
-
| 429 | `RateLimitError` |
|
|
89
|
-
| >=500 | `InternalServerError` |
|
|
90
|
-
| N/A | `APIConnectionError` |
|
|
91
|
-
|
|
92
|
-
### Retries
|
|
93
|
-
|
|
94
|
-
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
|
|
95
|
-
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
|
|
96
|
-
429 Rate Limit, and >=500 Internal errors will all be retried by default.
|
|
97
|
-
|
|
98
|
-
You can use the `maxRetries` option to configure or disable this:
|
|
99
|
-
|
|
100
|
-
<!-- prettier-ignore -->
|
|
101
|
-
```js
|
|
102
|
-
// Configure the default for all requests:
|
|
103
|
-
const dub = new Dub({
|
|
104
|
-
maxRetries: 0, // default is 2
|
|
105
|
-
projectSlug: 'dub_project_slug',
|
|
106
|
-
});
|
|
199
|
+
<!-- Start Server Selection [server] -->
|
|
200
|
+
## Server Selection
|
|
107
201
|
|
|
108
|
-
|
|
109
|
-
await dub.projects.retrieve({ projectSlug: 'REPLACE_ME' }, {
|
|
110
|
-
maxRetries: 5,
|
|
111
|
-
});
|
|
112
|
-
```
|
|
202
|
+
### Select Server by Index
|
|
113
203
|
|
|
114
|
-
|
|
204
|
+
You can override the default server globally by passing a server index to the `serverIdx` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
|
|
115
205
|
|
|
116
|
-
|
|
206
|
+
| # | Server | Variables |
|
|
207
|
+
| - | ------ | --------- |
|
|
208
|
+
| 0 | `https://api.dub.co` | None |
|
|
117
209
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
// Configure the default for all requests:
|
|
121
|
-
const dub = new Dub({
|
|
122
|
-
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
|
|
123
|
-
projectSlug: 'dub_project_slug',
|
|
124
|
-
});
|
|
210
|
+
```typescript
|
|
211
|
+
import { Dub } from "dub";
|
|
125
212
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
213
|
+
async function run() {
|
|
214
|
+
const sdk = new Dub({
|
|
215
|
+
serverIdx: 0,
|
|
216
|
+
token: "<YOUR_BEARER_TOKEN_HERE>",
|
|
217
|
+
workspaceId: "<value>",
|
|
218
|
+
projectSlug: "<value>",
|
|
219
|
+
});
|
|
131
220
|
|
|
132
|
-
|
|
221
|
+
const result = await sdk.links.list({
|
|
222
|
+
tagIds: ["<value>"],
|
|
223
|
+
});
|
|
133
224
|
|
|
134
|
-
|
|
225
|
+
// Handle the result
|
|
226
|
+
console.log(result);
|
|
227
|
+
}
|
|
135
228
|
|
|
136
|
-
|
|
229
|
+
run();
|
|
137
230
|
|
|
138
|
-
|
|
231
|
+
```
|
|
139
232
|
|
|
140
|
-
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
|
|
141
233
|
|
|
142
|
-
|
|
234
|
+
### Override Server URL Per-Client
|
|
143
235
|
|
|
144
|
-
|
|
145
|
-
```ts
|
|
146
|
-
const dub = new Dub();
|
|
236
|
+
The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example:
|
|
147
237
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
console.log(response.statusText); // access the underlying Response object
|
|
238
|
+
```typescript
|
|
239
|
+
import { Dub } from "dub";
|
|
151
240
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
241
|
+
async function run() {
|
|
242
|
+
const sdk = new Dub({
|
|
243
|
+
serverURL: "https://api.dub.co",
|
|
244
|
+
token: "<YOUR_BEARER_TOKEN_HERE>",
|
|
245
|
+
workspaceId: "<value>",
|
|
246
|
+
projectSlug: "<value>",
|
|
247
|
+
});
|
|
158
248
|
|
|
159
|
-
|
|
249
|
+
const result = await sdk.links.list({
|
|
250
|
+
tagIds: ["<value>"],
|
|
251
|
+
});
|
|
160
252
|
|
|
161
|
-
|
|
253
|
+
// Handle the result
|
|
254
|
+
console.log(result);
|
|
255
|
+
}
|
|
162
256
|
|
|
163
|
-
|
|
164
|
-
(for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`),
|
|
165
|
-
add the following import before your first import `from "Dub"`:
|
|
257
|
+
run();
|
|
166
258
|
|
|
167
|
-
```ts
|
|
168
|
-
// Tell TypeScript and the package to use the global web fetch instead of node-fetch.
|
|
169
|
-
// Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
|
|
170
|
-
import 'dub/shims/web';
|
|
171
|
-
import Dub from 'dub';
|
|
172
259
|
```
|
|
260
|
+
<!-- End Server Selection [server] -->
|
|
261
|
+
|
|
262
|
+
<!-- Start Custom HTTP Client [http-client] -->
|
|
263
|
+
## Custom HTTP Client
|
|
264
|
+
|
|
265
|
+
The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
|
|
266
|
+
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
|
|
267
|
+
client is a thin wrapper around `fetch` and provides the ability to attach hooks
|
|
268
|
+
around the request lifecycle that can be used to modify the request or handle
|
|
269
|
+
errors and response.
|
|
270
|
+
|
|
271
|
+
The `HTTPClient` constructor takes an optional `fetcher` argument that can be
|
|
272
|
+
used to integrate a third-party HTTP client or when writing tests to mock out
|
|
273
|
+
the HTTP client and feed in fixtures.
|
|
274
|
+
|
|
275
|
+
The following example shows how to use the `"beforeRequest"` hook to to add a
|
|
276
|
+
custom header and a timeout to requests and how to use the `"requestError"` hook
|
|
277
|
+
to log errors:
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
import { Dub } from "dub";
|
|
281
|
+
import { HTTPClient } from "dub/lib/http";
|
|
282
|
+
|
|
283
|
+
const httpClient = new HTTPClient({
|
|
284
|
+
// fetcher takes a function that has the same signature as native `fetch`.
|
|
285
|
+
fetcher: (request) => {
|
|
286
|
+
return fetch(request);
|
|
287
|
+
}
|
|
288
|
+
});
|
|
173
289
|
|
|
174
|
-
|
|
175
|
-
|
|
290
|
+
httpClient.addHook("beforeRequest", (request) => {
|
|
291
|
+
const nextRequest = new Request(request, {
|
|
292
|
+
signal: request.signal || AbortSignal.timeout(5000);
|
|
293
|
+
});
|
|
176
294
|
|
|
177
|
-
|
|
178
|
-
which can be used to inspect or alter the `Request` or `Response` before/after each request:
|
|
295
|
+
nextRequest.headers.set("x-custom-header", "custom value");
|
|
179
296
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
import Dub from 'dub';
|
|
297
|
+
return nextRequest;
|
|
298
|
+
});
|
|
183
299
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
return response;
|
|
190
|
-
},
|
|
300
|
+
httpClient.addHook("requestError", (error, request) => {
|
|
301
|
+
console.group("Request Error");
|
|
302
|
+
console.log("Reason:", `${error}`);
|
|
303
|
+
console.log("Endpoint:", `${request.method} ${request.url}`);
|
|
304
|
+
console.groupEnd();
|
|
191
305
|
});
|
|
192
|
-
```
|
|
193
306
|
|
|
194
|
-
|
|
195
|
-
|
|
307
|
+
const sdk = new Dub({ httpClient });
|
|
308
|
+
```
|
|
309
|
+
<!-- End Custom HTTP Client [http-client] -->
|
|
196
310
|
|
|
197
|
-
|
|
311
|
+
<!-- Start Authentication [security] -->
|
|
312
|
+
## Authentication
|
|
198
313
|
|
|
199
|
-
|
|
314
|
+
### Per-Client Security Schemes
|
|
200
315
|
|
|
201
|
-
|
|
316
|
+
This SDK supports the following security scheme globally:
|
|
202
317
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
import { HttpsProxyAgent } from 'https-proxy-agent';
|
|
318
|
+
| Name | Type | Scheme |
|
|
319
|
+
| ----------- | ----------- | ----------- |
|
|
320
|
+
| `token` | http | HTTP Bearer |
|
|
207
321
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
projectSlug: 'dub_project_slug',
|
|
212
|
-
});
|
|
322
|
+
To authenticate with the API the `token` parameter must be set when initializing the SDK client instance. For example:
|
|
323
|
+
```typescript
|
|
324
|
+
import { Dub } from "dub";
|
|
213
325
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
);
|
|
221
|
-
```
|
|
326
|
+
async function run() {
|
|
327
|
+
const sdk = new Dub({
|
|
328
|
+
token: "<YOUR_BEARER_TOKEN_HERE>",
|
|
329
|
+
workspaceId: "<value>",
|
|
330
|
+
projectSlug: "<value>",
|
|
331
|
+
});
|
|
222
332
|
|
|
223
|
-
|
|
333
|
+
const result = await sdk.links.list({
|
|
334
|
+
tagIds: ["<value>"],
|
|
335
|
+
});
|
|
224
336
|
|
|
225
|
-
|
|
337
|
+
// Handle the result
|
|
338
|
+
console.log(result);
|
|
339
|
+
}
|
|
226
340
|
|
|
227
|
-
|
|
228
|
-
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
|
|
229
|
-
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
341
|
+
run();
|
|
230
342
|
|
|
231
|
-
|
|
343
|
+
```
|
|
344
|
+
<!-- End Authentication [security] -->
|
|
232
345
|
|
|
233
|
-
|
|
346
|
+
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
234
347
|
|
|
235
|
-
|
|
348
|
+
# Development
|
|
236
349
|
|
|
237
|
-
|
|
350
|
+
## Maturity
|
|
238
351
|
|
|
239
|
-
|
|
352
|
+
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
|
|
353
|
+
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
|
|
354
|
+
looking for the latest version.
|
|
240
355
|
|
|
241
|
-
|
|
242
|
-
- Deno v1.28.0 or higher, using `import Dub from "npm:dub"`.
|
|
243
|
-
- Bun 1.0 or later.
|
|
244
|
-
- Cloudflare Workers.
|
|
245
|
-
- Vercel Edge Runtime.
|
|
246
|
-
- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
|
|
247
|
-
- Nitro v2.6 or greater.
|
|
356
|
+
## Contributions
|
|
248
357
|
|
|
249
|
-
|
|
358
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
359
|
+
Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!
|
|
250
360
|
|
|
251
|
-
|
|
361
|
+
### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)
|