Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/sdk_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
id-token: write
"on":
pull_request:
branches:
- main
paths:
- '**'
workflow_dispatch:
inputs:
target:
description: Provided SDK target to run tests for, (all) is valid
type: string
jobs:
test:
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-test.yaml@v15
with:
target: ${{ github.event.inputs.target || 'my-first-target' }}
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
145 changes: 103 additions & 42 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
mockServer:
disabled: true
tests:
generateNewTests: true
skipResponseBodyAssertions: false
typescript:
version: 0.61.11
version: 0.61.31
additionalDependencies:
dependencies: {}
devDependencies:
Expand Down
1 change: 1 addition & 0 deletions .speakeasy/testfiles/example.file
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello world
113 changes: 113 additions & 0 deletions .speakeasy/tests.arazzo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
arazzo: 1.0.1
info:
title: Test Suite
summary: Created from /Users/kiran/Desktop/dubinc/dub-ts/.speakeasy/temp/reformatted3027197700.json
version: 0.0.1
sourceDescriptions:
- name: /Users/kiran/Desktop/dubinc/dub-ts/.speakeasy/temp/reformatted3027197700.json
url: https://TBD.com
type: openapi
workflows:
- workflowId: createTag
steps:
- stepId: test
operationId: createTag
requestBody:
contentType: application/json
payload: {"name": "Marketing", "color": "blue"}
successCriteria:
- condition: $statusCode == 201
- condition: $response.header.Content-Type == application/json
- context: $response.body
condition: |
{
"id": "\u003cid\u003e",
"name": "\u003cvalue\u003e",
"color": "blue"
}
type: simple
x-speakeasy-test-group: Tags
- workflowId: getTags
steps:
- stepId: test
operationId: getTags
parameters:
- name: sortBy
in: query
value: name
- name: sortOrder
in: query
value: asc
- name: page
in: query
value: 1
- name: pageSize
in: query
value: 50
successCriteria:
- condition: $statusCode == 200
- condition: $response.header.Content-Type == application/json
- context: $response.body
condition: |
[
{
"id": "\u003cid\u003e",
"name": "\u003cvalue\u003e",
"color": "blue"
},
{
"id": "\u003cid\u003e",
"name": "\u003cvalue\u003e",
"color": "purple"
},
{
"id": "\u003cid\u003e",
"name": "\u003cvalue\u003e",
"color": "yellow"
}
]
type: simple
x-speakeasy-test-group: Tags
- workflowId: updateTag
steps:
- stepId: test
operationId: updateTag
parameters:
- name: id
in: path
value: <id>
successCriteria:
- condition: $statusCode == 200
- condition: $response.header.Content-Type == application/json
- context: $response.body
condition: |
{
"id": "\u003cid\u003e",
"name": "\u003cvalue\u003e",
"color": "brown"
}
type: simple
x-speakeasy-test-group: Tags
- workflowId: deleteTag
steps:
- stepId: test
operationId: deleteTag
parameters:
- name: id
in: path
value: <id>
successCriteria:
- condition: $statusCode == 200
- condition: $response.header.Content-Type == application/json
- context: $response.body
condition: |
{
"id": "\u003cid\u003e"
}
type: simple
x-speakeasy-test-group: Tags
x-speakeasy-test-server:
baseUrl: "http://api.localhost:8888"
x-speakeasy-test-security:
value:
token: "x-env: DUB_API_KEY"
17 changes: 9 additions & 8 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
speakeasyVersion: 1.542.3
speakeasyVersion: 1.543.8
sources:
my-first-source:
sourceNamespace: my-first-source
sourceRevisionDigest: sha256:a882aac08633830b5efed172d9a18707fab166fe6a690a0bbf061be8ae26835b
sourceBlobDigest: sha256:175bb04362a90b099ecef0183043a35704ed119a2153475ffe059937ea964093
sourceRevisionDigest: sha256:b46e115f9f74a30e86d56e028a5c71a04fea3cc900be89fadaec67a9d91bc655
sourceBlobDigest: sha256:e7f231da8c3c395e899cc2f3b3191f0ea19af367f31091522f10dd0f79de18e5
tags:
- latest
- speakeasy-sdk-regen-1746145779
- 0.0.1
targets:
my-first-target:
source: my-first-source
sourceNamespace: my-first-source
sourceRevisionDigest: sha256:a882aac08633830b5efed172d9a18707fab166fe6a690a0bbf061be8ae26835b
sourceBlobDigest: sha256:175bb04362a90b099ecef0183043a35704ed119a2153475ffe059937ea964093
sourceRevisionDigest: sha256:b46e115f9f74a30e86d56e028a5c71a04fea3cc900be89fadaec67a9d91bc655
sourceBlobDigest: sha256:e7f231da8c3c395e899cc2f3b3191f0ea19af367f31091522f10dd0f79de18e5
codeSamplesNamespace: code-samples-typescript-my-first-target
codeSamplesRevisionDigest: sha256:5be92f2d455f25a0d6176be95326699ec9a74e6b10ac0b502ed1b1f4e28ff9f0
codeSamplesRevisionDigest: sha256:2b819e71cce0f773958ebbad663c89d10d834843489765f5582d8f1f820b80e2
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
my-first-source:
inputs:
- location: https://api.dub.co
- location: http://api.localhost:8888
registry:
location: registry.speakeasyapi.dev/dub/dub/my-first-source
targets:
Expand All @@ -36,3 +35,5 @@ workflow:
output: codeSamples.yaml
registry:
location: registry.speakeasyapi.dev/dub/dub/code-samples-typescript-my-first-target
testing:
enabled: true
4 changes: 3 additions & 1 deletion .speakeasy/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ speakeasyVersion: latest
sources:
my-first-source:
inputs:
- location: https://api.dub.co
- location: http://api.localhost:8888
registry:
location: registry.speakeasyapi.dev/dub/dub/my-first-source
targets:
Expand All @@ -17,3 +17,5 @@ targets:
output: codeSamples.yaml
registry:
location: registry.speakeasyapi.dev/dub/dub/code-samples-typescript-my-first-target
testing:
enabled: true
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ run();

* [retrieve](docs/sdks/analytics/README.md#retrieve) - Retrieve analytics for a link, a domain, or the authenticated workspace.

### [commissions](docs/sdks/commissions/README.md)

* [list](docs/sdks/commissions/README.md#list) - Get commissions for a program.
* [update](docs/sdks/commissions/README.md#update) - Update a commission.

### [customers](docs/sdks/customers/README.md)

* [list](docs/sdks/customers/README.md#list) - Retrieve a list of customers
Expand Down Expand Up @@ -262,7 +267,6 @@ run();
* [retrieveLinks](docs/sdks/partners/README.md#retrievelinks) - Retrieve a partner's links.
* [upsertLink](docs/sdks/partners/README.md#upsertlink) - Upsert a link for a partner
* [analytics](docs/sdks/partners/README.md#analytics) - Retrieve analytics for a partner
* [updateSale](docs/sdks/partners/README.md#updatesale) - Update a sale for a partner.

### [qrCodes](docs/sdks/qrcodes/README.md)

Expand Down Expand Up @@ -634,6 +638,8 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
<summary>Available standalone functions</summary>

- [`analyticsRetrieve`](docs/sdks/analytics/README.md#retrieve) - Retrieve analytics for a link, a domain, or the authenticated workspace.
- [`commissionsList`](docs/sdks/commissions/README.md#list) - Get commissions for a program.
- [`commissionsUpdate`](docs/sdks/commissions/README.md#update) - Update a commission.
- [`customersDelete`](docs/sdks/customers/README.md#delete) - Delete a customer
- [`customersGet`](docs/sdks/customers/README.md#get) - Retrieve a customer
- [`customersList`](docs/sdks/customers/README.md#list) - Retrieve a list of customers
Expand Down Expand Up @@ -662,7 +668,6 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
- [`partnersCreate`](docs/sdks/partners/README.md#create) - Create a partner
- [`partnersCreateLink`](docs/sdks/partners/README.md#createlink) - Create a link for a partner
- [`partnersRetrieveLinks`](docs/sdks/partners/README.md#retrievelinks) - Retrieve a partner's links.
- [`partnersUpdateSale`](docs/sdks/partners/README.md#updatesale) - Update a sale for a partner.
- [`partnersUpsertLink`](docs/sdks/partners/README.md#upsertlink) - Upsert a link for a partner
- [`qrCodesGet`](docs/sdks/qrcodes/README.md#get) - Retrieve a QR code
- [`tagsCreate`](docs/sdks/tags/README.md#create) - Create a tag
Expand Down
18 changes: 12 additions & 6 deletions codeSamples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ actions:
- "lang": "typescript"
"label": "retrieveAnalytics"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.analytics.retrieve();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/commissions"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "listCommissions"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.commissions.list();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/commissions/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "updateCommission"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.commissions.update({\n id: \"cm_1JVR7XRCSR0EDBAF39FZ4PMYE\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/customers"]["get"]
update:
"x-codeSamples":
Expand Down Expand Up @@ -177,12 +189,6 @@ actions:
- "lang": "typescript"
"label": "upsertPartnerLink"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.partners.upsertLink();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/partners/sales"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "updatePartnerSale"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.partners.updateSale();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/qr"]["get"]
update:
"x-codeSamples":
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/analyticstoplinks.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let value: AnalyticsTopLinks = {
key: "<key>",
shortLink: "<value>",
url: "https://limited-onset.com",
createdAt: "1734733846845",
createdAt: "1736502914639",
};
```

Expand Down
6 changes: 3 additions & 3 deletions docs/models/components/clickevent.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let value: ClickEvent = {
programId: "<id>",
partnerId: "<id>",
archived: false,
expiresAt: "1761291730626",
expiresAt: "1763060800414",
expiredUrl: "https://awesome-loaf.name",
password: "APvsoMbrZcB4BkV",
proxy: false,
Expand Down Expand Up @@ -75,8 +75,8 @@ let value: ClickEvent = {
userId: "<id>",
workspaceId: "<id>",
lastClicked: "<value>",
createdAt: "1715940649992",
updatedAt: "1746456377034",
createdAt: "1717709719782",
updatedAt: "1748225446823",
projectId: "<id>",
},
clickId: "<id>",
Expand Down
4 changes: 3 additions & 1 deletion docs/models/components/customer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let value: Customer = {
id: "<id>",
externalId: "<id>",
name: "<value>",
createdAt: "1741402435729",
createdAt: "1743171502795",
};
```

Expand All @@ -23,4 +23,6 @@ let value: Customer = {
| `email` | *string* | :heavy_minus_sign: | Email of the customer. |
| `avatar` | *string* | :heavy_minus_sign: | Avatar URL of the customer. |
| `country` | *string* | :heavy_minus_sign: | Country of the customer. |
| `sales` | *number* | :heavy_minus_sign: | Total number of sales for the customer. |
| `saleAmount` | *number* | :heavy_minus_sign: | Total amount of sales for the customer. |
| `createdAt` | *string* | :heavy_check_mark: | The date the customer was created. |
6 changes: 3 additions & 3 deletions docs/models/components/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let value: Data = {
programId: "<id>",
partnerId: "<id>",
archived: false,
expiresAt: "1763653950176",
expiresAt: "1765423017324",
expiredUrl: "https://roasted-sarong.net/",
password: "mfjOcY3R8z5E_hw",
proxy: false,
Expand Down Expand Up @@ -73,8 +73,8 @@ let value: Data = {
userId: "<id>",
workspaceId: "<id>",
lastClicked: "<value>",
createdAt: "1732983407767",
updatedAt: "1746425072535",
createdAt: "1734752474900",
updatedAt: "1748194139669",
projectId: "<id>",
},
};
Expand Down
8 changes: 4 additions & 4 deletions docs/models/components/domainschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ let value: DomainSchema = {
expiredUrl: "https://acme.com/expired",
notFoundUrl: "https://acme.com/not-found",
logo: "<value>",
createdAt: "1723130577854",
updatedAt: "1746474416400",
createdAt: "1724899641186",
updatedAt: "1748243479732",
registeredDomain: {
id: "<id>",
createdAt: "1720179502808",
expiresAt: "1758035136897",
createdAt: "1721948566139",
expiresAt: "1759804200228",
},
};
```
Expand Down
4 changes: 2 additions & 2 deletions docs/models/components/folderschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ let value: FolderSchema = {
id: "<id>",
name: "<value>",
type: "mega",
createdAt: "1735531034317",
updatedAt: "1746454959381",
createdAt: "1737300099097",
updatedAt: "1748224024161",
};
```

Expand Down
Loading