Skip to content

Commit b862389

Browse files
committed
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.376.0
1 parent f6888a3 commit b862389

File tree

232 files changed

+9176
-4982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+9176
-4982
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/funcs
2+
/core.*
13
/esm
24
/dist
35
/.tshy

.speakeasy/gen.lock

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
lockVersion: 2.0.0
22
id: f28179cc-ef59-426d-9e85-60cec22fc642
33
management:
4-
docChecksum: e0d1746d131c608a54c04b32762b2faa
4+
docChecksum: f10061c7787170c0db643f22823c9aa9
55
docVersion: 0.0.1
6-
speakeasyVersion: 1.348.1
7-
generationVersion: 2.380.1
8-
releaseVersion: 0.35.0
9-
configChecksum: 87fbf74009c30c7040a96a9987cec680
6+
speakeasyVersion: 1.376.0
7+
generationVersion: 2.402.5
8+
releaseVersion: 0.36.0
9+
configChecksum: fcb98e68ac4052e8890047fc6babe86f
1010
repoURL: https://github.com/dubinc/dub-ts.git
1111
installationURL: https://github.com/dubinc/dub-ts
1212
published: true
1313
features:
1414
typescript:
1515
additionalDependencies: 0.1.0
16-
constsAndDefaults: 0.1.5
17-
core: 3.11.11
16+
constsAndDefaults: 0.1.10
17+
core: 3.14.1
1818
defaultEnabledRetries: 0.1.0
1919
deprecations: 2.81.1
20-
envVarSecurityUsage: 0.1.0
21-
errors: 2.81.12
20+
envVarSecurityUsage: 0.1.1
21+
errors: 2.82.1
2222
examples: 2.81.4
2323
flattening: 2.81.1
24-
globalSecurity: 2.82.9
24+
globalSecurity: 2.82.11
2525
globalSecurityCallbacks: 0.1.0
2626
globalSecurityFlattening: 0.1.0
2727
globalServerURLs: 2.82.4
@@ -31,11 +31,37 @@ features:
3131
responseFormat: 0.2.3
3232
retries: 2.83.0
3333
sdkHooks: 0.1.0
34-
unions: 2.85.6
34+
unions: 2.85.7
3535
generatedFiles:
36+
- src/funcs/linksList.ts
37+
- src/funcs/linksCreate.ts
38+
- src/funcs/linksCount.ts
39+
- src/funcs/linksGet.ts
40+
- src/funcs/linksDelete.ts
41+
- src/funcs/linksUpdate.ts
42+
- src/funcs/linksCreateMany.ts
43+
- src/funcs/linksUpdateMany.ts
44+
- src/funcs/linksUpsert.ts
45+
- src/funcs/qrCodesGet.ts
46+
- src/funcs/analyticsRetrieve.ts
47+
- src/funcs/eventsList.ts
48+
- src/funcs/workspacesGet.ts
49+
- src/funcs/workspacesUpdate.ts
50+
- src/funcs/tagsList.ts
51+
- src/funcs/tagsCreate.ts
52+
- src/funcs/tagsUpdate.ts
53+
- src/funcs/domainsList.ts
54+
- src/funcs/domainsCreate.ts
55+
- src/funcs/domainsDelete.ts
56+
- src/funcs/domainsUpdate.ts
57+
- src/funcs/trackLead.ts
58+
- src/funcs/trackSale.ts
59+
- src/funcs/trackCustomer.ts
60+
- src/funcs/metatagsGet.ts
3661
- src/sdk/links.ts
3762
- src/sdk/qrcodes.ts
3863
- src/sdk/analytics.ts
64+
- src/sdk/events.ts
3965
- src/sdk/workspaces.ts
4066
- src/sdk/tags.ts
4167
- src/sdk/domains.ts
@@ -44,26 +70,33 @@ generatedFiles:
4470
- src/sdk/sdk.ts
4571
- .eslintrc.cjs
4672
- .npmignore
73+
- FUNCTIONS.md
4774
- RUNTIMES.md
4875
- jsr.json
4976
- package.json
77+
- src/core.ts
5078
- src/lib/base64.ts
5179
- src/lib/config.ts
5280
- src/lib/dlv.ts
5381
- src/lib/encodings.ts
5482
- src/lib/http.ts
5583
- src/lib/is-plain-object.ts
84+
- src/lib/logger.ts
85+
- src/lib/matchers.ts
5686
- src/lib/primitives.ts
5787
- src/lib/retries.ts
5888
- src/lib/schemas.ts
5989
- src/lib/sdks.ts
6090
- src/lib/security.ts
6191
- src/lib/url.ts
6292
- src/sdk/index.ts
93+
- src/models/errors/httpclienterrors.ts
6394
- src/models/errors/sdkerror.ts
6495
- src/models/errors/sdkvalidationerror.ts
6596
- src/types/blobs.ts
97+
- src/types/constdatetime.ts
6698
- src/types/enums.ts
99+
- src/types/fp.ts
67100
- src/types/index.ts
68101
- src/types/operations.ts
69102
- src/types/rfcdate.ts
@@ -79,6 +112,7 @@ generatedFiles:
79112
- src/models/operations/upsertlink.ts
80113
- src/models/operations/getqrcode.ts
81114
- src/models/operations/retrieveanalytics.ts
115+
- src/models/operations/listevents.ts
82116
- src/models/operations/getworkspace.ts
83117
- src/models/operations/updateworkspace.ts
84118
- src/models/operations/createtag.ts
@@ -126,6 +160,7 @@ generatedFiles:
126160
- src/models/components/salestopurls.ts
127161
- src/models/components/countrycode.ts
128162
- src/models/components/continentcode.ts
163+
- src/models/components/clickevents.ts
129164
- src/models/components/workspaceschema.ts
130165
- src/models/components/domainschema.ts
131166
- src/models/components/security.ts
@@ -180,6 +215,11 @@ generatedFiles:
180215
- docs/models/operations/interval.md
181216
- docs/models/operations/retrieveanalyticsrequest.md
182217
- docs/models/operations/retrieveanalyticsresponsebody.md
218+
- docs/models/operations/queryparamevent.md
219+
- docs/models/operations/queryparaminterval.md
220+
- docs/models/operations/order.md
221+
- docs/models/operations/sortby.md
222+
- docs/models/operations/listeventsrequest.md
183223
- docs/models/operations/getworkspacerequest.md
184224
- docs/models/operations/updateworkspacerequestbody.md
185225
- docs/models/operations/updateworkspacerequest.md
@@ -247,6 +287,7 @@ generatedFiles:
247287
- docs/models/components/salestopurls.md
248288
- docs/models/components/countrycode.md
249289
- docs/models/components/continentcode.md
290+
- docs/models/components/clickevents.md
250291
- docs/models/components/plan.md
251292
- docs/models/components/role.md
252293
- docs/models/components/users.md
@@ -286,6 +327,7 @@ generatedFiles:
286327
- docs/sdks/links/README.md
287328
- docs/sdks/qrcodes/README.md
288329
- docs/sdks/analytics/README.md
330+
- docs/sdks/events/README.md
289331
- docs/sdks/workspaces/README.md
290332
- docs/sdks/tags/README.md
291333
- docs/sdks/domains/README.md

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ generation:
1212
auth:
1313
oAuth2ClientCredentialsEnabled: false
1414
typescript:
15-
version: 0.35.0
15+
version: 0.36.0
1616
additionalDependencies:
1717
dependencies: {}
1818
devDependencies:

.speakeasy/workflow.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
speakeasyVersion: 1.348.1
1+
speakeasyVersion: 1.376.0
22
sources:
33
my-first-source:
44
sourceNamespace: my-first-source
5-
sourceRevisionDigest: sha256:4d78d78685a08202f85a9716ff9e5768ff4b067d2ce464808d83952744a57381
6-
sourceBlobDigest: sha256:0c65956649d3eb4dc5a19103b2efd8d2a0cd19c58b6241fac24217c4d36014ae
5+
sourceRevisionDigest: sha256:de430b5c0a945576e78a236b995496062842030be9ccf4029f51404aa5c31bae
6+
sourceBlobDigest: sha256:95a8dafd6f02195984538c42d60d9df2182a04eb50f3954f50aa24872b1814c2
77
tags:
88
- latest
99
- main
1010
targets:
1111
my-first-target:
1212
source: my-first-source
1313
sourceNamespace: my-first-source
14-
sourceRevisionDigest: sha256:4d78d78685a08202f85a9716ff9e5768ff4b067d2ce464808d83952744a57381
15-
sourceBlobDigest: sha256:0c65956649d3eb4dc5a19103b2efd8d2a0cd19c58b6241fac24217c4d36014ae
14+
sourceRevisionDigest: sha256:de430b5c0a945576e78a236b995496062842030be9ccf4029f51404aa5c31bae
15+
sourceBlobDigest: sha256:95a8dafd6f02195984538c42d60d9df2182a04eb50f3954f50aa24872b1814c2
1616
codeSamplesNamespace: code-samples-typescript-my-first-target
17-
codeSamplesRevisionDigest: sha256:8d89f25edfe9e291b4ad380de610b887cfdba3ed3605c8c0e2949bb435949eaf
17+
codeSamplesRevisionDigest: sha256:2ffe1d4d7e8e6894db67c985fa5142acf2f1372b9e63b8e7aeaf23875dffc67e
1818
outLocation: /github/workspace/repo
1919
workflow:
2020
workflowVersion: 1.0.0

FUNCTIONS.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Standalone Functions
2+
3+
> [!NOTE]
4+
> This section is useful if you are using a bundler and targetting browsers and
5+
> runtimes where the size of an application affects performance and load times.
6+
7+
Every method in this SDK is also available as a standalone function. This
8+
alternative API is suitable when targetting the browser or serverless runtimes
9+
and using a bundler to build your application since all unused functionality
10+
will be tree-shaken away. This includes code for unused methods, Zod schemas,
11+
encoding helpers and response handlers. The result is dramatically smaller
12+
impact on the application's final bundle size which grows very slowly as you use
13+
more and more functionality from this SDK.
14+
15+
Calling methods through the main SDK class remains a valid and generally more
16+
more ergonomic option. Standalone functions represent an optimisation for a
17+
specific category of applications.
18+
19+
## Example
20+
21+
```typescript
22+
import { DubCore } from "dub/core.js";
23+
import { linksCreate } from "dub/funcs/linksCreate.js";
24+
import { SDKValidationError } from "dub/models/errors/sdkvalidationerror.js";
25+
26+
// Use `DubCore` for best tree-shaking performance.
27+
// You can create one instance of it to use across an application.
28+
const dub = new DubCore({
29+
token: "DUB_API_KEY",
30+
});
31+
32+
async function run() {
33+
const res = await linksCreate(dub);
34+
35+
switch (true) {
36+
case res.ok:
37+
// The success case will be handled outside of the switch block
38+
break;
39+
case res.error instanceof SDKValidationError:
40+
// Pretty-print validation errors.
41+
return console.log(res.error.pretty());
42+
case res.error instanceof Error:
43+
return console.log(res.error);
44+
default:
45+
// TypeScript's type checking will fail on the following line if the above
46+
// cases were not exhaustive.
47+
res.error satisfies never;
48+
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
49+
}
50+
51+
52+
const { value: result } = res;
53+
54+
// Handle the result
55+
console.log(result)
56+
}
57+
58+
run();
59+
```
60+
61+
## Result types
62+
63+
Standalone functions differ from SDK methods in that they return a
64+
`Result<Value, Error>` type to capture _known errors_ and document them using
65+
the type system. By avoiding throwing errors, application code maintains clear
66+
control flow and error-handling become part of the regular flow of application
67+
code.
68+
69+
> We use the term "known errors" because standalone functions, and JavaScript
70+
> code in general, can still throw unexpected errors such as `TypeError`s,
71+
> `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
72+
> something this SDK addresses in the future. Nevertheless, there is still a lot
73+
> of benefit from capturing most errors and turning them into values.
74+
75+
The second reason for this style of programming is because these functions will
76+
typically be used in front-end applications where exception throwing is
77+
sometimes discouraged or considered unidiomatic. React and similar ecosystems
78+
and libraries tend to promote this style of programming so that components
79+
render useful content under all states (loading, success, error and so on).
80+
81+
The general pattern when calling standalone functions looks like this:
82+
83+
```typescript
84+
import { Core } from "<sdk-package-name>";
85+
import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
86+
87+
const client = new Core();
88+
89+
async function run() {
90+
const result = await fetchSomething(client, { id: "123" });
91+
if (!result.ok) {
92+
// You can throw the error or handle it. It's your choice now.
93+
throw result.error;
94+
}
95+
96+
console.log(result.value);
97+
}
98+
99+
run();
100+
```
101+
102+
Notably, `result.error` above will have an explicit type compared to a try-catch
103+
variation where the error in the catch block can only be of type `unknown` (or
104+
`any` depending on your TypeScript settings).

0 commit comments

Comments
 (0)