diff --git a/.github/workflows/sdk_test.yaml b/.github/workflows/sdk_test.yaml new file mode 100644 index 00000000..c1476b4b --- /dev/null +++ b/.github/workflows/sdk_test.yaml @@ -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 }} diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d5b1c92a..e87ffa6b 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: f28179cc-ef59-426d-9e85-60cec22fc642 management: - docChecksum: a7ba8704507363fabccfcbe7aad3310c + docChecksum: 2b47fe29b17b4d40c12623df1671b9e3 docVersion: 0.0.1 - speakeasyVersion: 1.542.3 - generationVersion: 2.597.9 - releaseVersion: 0.61.11 - configChecksum: d537a98a2f9f56dbaca258c38b054936 + speakeasyVersion: 1.543.8 + generationVersion: 2.598.22 + releaseVersion: 0.61.31 + configChecksum: 122267166f6923c27b68edc0a2b16ab2 repoURL: https://github.com/dubinc/dub-ts.git installationURL: https://github.com/dubinc/dub-ts published: true @@ -25,7 +25,7 @@ features: globalSecurity: 2.82.13 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 - globalServerURLs: 2.82.4 + globalServerURLs: 2.82.5 includes: 2.81.1 mcpServer: 0.9.2 methodArguments: 0.1.2 @@ -35,6 +35,7 @@ features: responseFormat: 0.2.3 retries: 2.83.0 sdkHooks: 0.2.0 + tests: 0.16.2 unions: 2.85.8 generatedFiles: - .gitattributes @@ -206,6 +207,7 @@ generatedFiles: - docs/models/operations/createpartnerlinktestvariants.md - docs/models/operations/createpartnerrequestbody.md - docs/models/operations/createpartnerresponsebody.md + - docs/models/operations/createpartnerstatus.md - docs/models/operations/createpartnertagids.md - docs/models/operations/createpartnertagnames.md - docs/models/operations/createpartnertestvariants.md @@ -239,6 +241,8 @@ generatedFiles: - docs/models/operations/getcustomerresponsebody.md - docs/models/operations/getcustomerslink.md - docs/models/operations/getcustomerspartner.md + - docs/models/operations/getcustomersqueryparamsortby.md + - docs/models/operations/getcustomersqueryparamsortorder.md - docs/models/operations/getcustomersrequest.md - docs/models/operations/getcustomersresponsebody.md - docs/models/operations/getcustomerstype.md @@ -260,6 +264,13 @@ generatedFiles: - docs/models/operations/level.md - docs/models/operations/link.md - docs/models/operations/linkprops.md + - docs/models/operations/listcommissionsqueryparaminterval.md + - docs/models/operations/listcommissionsqueryparamsortby.md + - docs/models/operations/listcommissionsqueryparamsortorder.md + - docs/models/operations/listcommissionsrequest.md + - docs/models/operations/listcommissionsresponsebody.md + - docs/models/operations/listcommissionsstatus.md + - docs/models/operations/listcommissionstype.md - docs/models/operations/listdomainsrequest.md - docs/models/operations/listdomainsresponse.md - docs/models/operations/listeventsqueryparamtagids.md @@ -276,6 +287,7 @@ generatedFiles: - docs/models/operations/queryparaminterval.md - docs/models/operations/queryparamsortby.md - docs/models/operations/queryparamsortorder.md + - docs/models/operations/queryparamstatus.md - docs/models/operations/queryparamtagids.md - docs/models/operations/queryparamtagnames.md - docs/models/operations/queryparamtrigger.md @@ -306,6 +318,11 @@ generatedFiles: - docs/models/operations/trigger.md - docs/models/operations/two.md - docs/models/operations/type.md + - docs/models/operations/updatecommissionrequest.md + - docs/models/operations/updatecommissionrequestbody.md + - docs/models/operations/updatecommissionresponsebody.md + - docs/models/operations/updatecommissionstatus.md + - docs/models/operations/updatecommissiontype.md - docs/models/operations/updatecustomerdiscount.md - docs/models/operations/updatecustomerlink.md - docs/models/operations/updatecustomerpartner.md @@ -323,9 +340,6 @@ generatedFiles: - docs/models/operations/updatelinktagids.md - docs/models/operations/updatelinktagnames.md - docs/models/operations/updatelinktestvariants.md - - docs/models/operations/updatepartnersalerequestbody.md - - docs/models/operations/updatepartnersaleresponsebody.md - - docs/models/operations/updatepartnersalestatus.md - docs/models/operations/updatetagcolor.md - docs/models/operations/updatetagrequest.md - docs/models/operations/updatetagrequestbody.md @@ -341,6 +355,7 @@ generatedFiles: - docs/models/operations/upsertpartnerlinktagnames.md - docs/models/operations/upsertpartnerlinktestvariants.md - docs/sdks/analytics/README.md + - docs/sdks/commissions/README.md - docs/sdks/customers/README.md - docs/sdks/domains/README.md - docs/sdks/dub/README.md @@ -356,8 +371,14 @@ generatedFiles: - eslint.config.mjs - jsr.json - package.json + - src/__tests__/assertions.ts + - src/__tests__/files.ts + - src/__tests__/tags.test.ts + - src/__tests__/testclient.ts - src/core.ts - src/funcs/analyticsRetrieve.ts + - src/funcs/commissionsList.ts + - src/funcs/commissionsUpdate.ts - src/funcs/customersCreate.ts - src/funcs/customersDelete.ts - src/funcs/customersGet.ts @@ -387,7 +408,6 @@ generatedFiles: - src/funcs/partnersCreate.ts - src/funcs/partnersCreateLink.ts - src/funcs/partnersRetrieveLinks.ts - - src/funcs/partnersUpdateSale.ts - src/funcs/partnersUpsertLink.ts - src/funcs/qrCodesGet.ts - src/funcs/tagsCreate.ts @@ -430,6 +450,8 @@ generatedFiles: - src/mcp-server/shared.ts - src/mcp-server/tools.ts - src/mcp-server/tools/analyticsRetrieve.ts + - src/mcp-server/tools/commissionsList.ts + - src/mcp-server/tools/commissionsUpdate.ts - src/mcp-server/tools/customersCreate.ts - src/mcp-server/tools/customersDelete.ts - src/mcp-server/tools/customersGet.ts @@ -459,7 +481,6 @@ generatedFiles: - src/mcp-server/tools/partnersCreate.ts - src/mcp-server/tools/partnersCreateLink.ts - src/mcp-server/tools/partnersRetrieveLinks.ts - - src/mcp-server/tools/partnersUpdateSale.ts - src/mcp-server/tools/partnersUpsertLink.ts - src/mcp-server/tools/qrCodesGet.ts - src/mcp-server/tools/tagsCreate.ts @@ -545,6 +566,7 @@ generatedFiles: - src/models/operations/gettags.ts - src/models/operations/getworkspace.ts - src/models/operations/index.ts + - src/models/operations/listcommissions.ts - src/models/operations/listdomains.ts - src/models/operations/listevents.ts - src/models/operations/listfolders.ts @@ -553,16 +575,17 @@ generatedFiles: - src/models/operations/retrievepartneranalytics.ts - src/models/operations/tracklead.ts - src/models/operations/tracksale.ts + - src/models/operations/updatecommission.ts - src/models/operations/updatecustomer.ts - src/models/operations/updatedomain.ts - src/models/operations/updatefolder.ts - src/models/operations/updatelink.ts - - src/models/operations/updatepartnersale.ts - src/models/operations/updatetag.ts - src/models/operations/updateworkspace.ts - src/models/operations/upsertlink.ts - src/models/operations/upsertpartnerlink.ts - src/sdk/analytics.ts + - src/sdk/commissions.ts - src/sdk/customers.ts - src/sdk/domains.ts - src/sdk/embedtokens.ts @@ -591,7 +614,7 @@ examples: speakeasy-default-create-link: responses: "200": - application/json: {"id": "", "domain": "low-packaging.info", "key": "", "url": "https://black-and-white-secrecy.org/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1745204903696", "expiredUrl": "https://brisk-seafood.net/", "password": "XhB9652A4R_UwKP", "proxy": false, "title": "", "description": "demob fencing fencing vainly kookily", "image": "https://picsum.photos/seed/zicqIZPdCh/2719/290", "video": "https://loremflickr.com/2433/1085?lock=5492184885451890", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "pink"}, {"id": "", "name": "", "color": "pink"}], "folderId": "", "webhookIds": [], "comments": "than rightfully brightly sleet where schedule insolence when warming when determined ouch scarcely ignorance", "shortLink": "https://incomparable-monster.net/", "qrCode": "https://mild-switchboard.info/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1723531037431", "updatedAt": "1745192270066", "projectId": ""} + application/json: {"id": "", "domain": "low-packaging.info", "key": "", "url": "https://black-and-white-secrecy.org/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1748263206291", "expiredUrl": "https://brisk-seafood.net/", "password": "XhB9652A4R_UwKP", "proxy": false, "title": "", "description": "demob fencing fencing vainly kookily", "image": "https://picsum.photos/seed/zicqIZPdCh/2719/290", "video": "https://loremflickr.com/2433/1085?lock=5492184885451890", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "pink"}, {"id": "", "name": "", "color": "pink"}], "folderId": "", "webhookIds": [], "comments": "than rightfully brightly sleet where schedule insolence when warming when determined ouch scarcely ignorance", "shortLink": "https://incomparable-monster.net/", "qrCode": "https://mild-switchboard.info/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1726589339987", "updatedAt": "1748250572621", "projectId": ""} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -622,7 +645,7 @@ examples: pageSize: 50 responses: "200": - application/json: [{"id": "", "domain": "neglected-plastic.biz", "key": "", "url": "https://crooked-overload.name/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1745756493614", "expiredUrl": "https://breakable-bathrobe.net", "password": "QCOyVtOrvIw1vLI", "proxy": false, "title": "", "description": "beside tromp worth reluctantly wound accompanist", "image": "https://picsum.photos/seed/WT1tZJLp/3243/3827", "video": "https://picsum.videos/seed/p2Pkp47W/118/2609", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "green"}, {"id": "", "name": "", "color": "green"}, {"id": "", "name": "", "color": "blue"}], "folderId": "", "webhookIds": [], "comments": "commonly softly boo massive sorrowful aw strict behind along energetic oddball pasta thread vestment meanwhile likely up questionably forgery", "shortLink": "https://oblong-inspection.net", "qrCode": "https://spherical-gerbil.org/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1729312896017", "updatedAt": "1745200926259", "projectId": ""}, {"id": "", "domain": "married-presume.net", "key": "", "url": "https://reflecting-coast.info", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1762998604262", "expiredUrl": "https://writhing-conversation.com", "password": "ZsCSHb4yMlkCXkK", "proxy": false, "title": "", "description": "overcook till boo ack solicit", "image": "https://loremflickr.com/2989/2665?lock=5845099426147813", "video": "https://picsum.videos/seed/breY1MLSO6/954/73", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "brown"}, {"id": "", "name": "", "color": "red"}], "folderId": "", "webhookIds": [""], "comments": "instead athwart before tattered gosh um what thump kettledrum configuration esteemed mysteriously legend absent brr", "shortLink": "https://well-documented-help.biz/", "qrCode": "https://untrue-lamp.info/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1737089022845", "updatedAt": "1745154734561", "projectId": ""}, {"id": "", "domain": "stale-handful.com", "key": "", "url": "https://lean-daughter.org", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1756506134211", "expiredUrl": "https://perfumed-marketplace.com/", "password": "xsCzKbmqqqJnqbw", "proxy": false, "title": "", "description": "as so yet whenever rotating hygienic mid", "image": "https://loremflickr.com/958/3484?lock=3072922795184569", "video": "https://loremflickr.com/565/2800?lock=8555441928057420", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "blue"}, {"id": "", "name": "", "color": "purple"}, {"id": "", "name": "", "color": "yellow"}], "folderId": "", "webhookIds": ["", ""], "comments": "polished whether welcome deck gratefully for outfox pfft indeed phew rejigger overcoat when wonderful ugh before however fooey weakly", "shortLink": "https://muddy-nightlife.info/", "qrCode": "https://cloudy-tackle.net/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1722178659624", "updatedAt": "1745161083500", "projectId": ""}] + application/json: [{"id": "", "domain": "neglected-plastic.biz", "key": "", "url": "https://crooked-overload.name/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1748814796155", "expiredUrl": "https://breakable-bathrobe.net", "password": "QCOyVtOrvIw1vLI", "proxy": false, "title": "", "description": "beside tromp worth reluctantly wound accompanist", "image": "https://picsum.photos/seed/WT1tZJLp/3243/3827", "video": "https://picsum.videos/seed/p2Pkp47W/118/2609", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "green"}, {"id": "", "name": "", "color": "green"}, {"id": "", "name": "", "color": "blue"}], "folderId": "", "webhookIds": [], "comments": "commonly softly boo massive sorrowful aw strict behind along energetic oddball pasta thread vestment meanwhile likely up questionably forgery", "shortLink": "https://oblong-inspection.net", "qrCode": "https://spherical-gerbil.org/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1732371198546", "updatedAt": "1748259228788", "projectId": ""}, {"id": "", "domain": "married-presume.net", "key": "", "url": "https://reflecting-coast.info", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1766056906790", "expiredUrl": "https://writhing-conversation.com", "password": "ZsCSHb4yMlkCXkK", "proxy": false, "title": "", "description": "overcook till boo ack solicit", "image": "https://loremflickr.com/2989/2665?lock=5845099426147813", "video": "https://picsum.videos/seed/breY1MLSO6/954/73", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "brown"}, {"id": "", "name": "", "color": "red"}], "folderId": "", "webhookIds": [""], "comments": "instead athwart before tattered gosh um what thump kettledrum configuration esteemed mysteriously legend absent brr", "shortLink": "https://well-documented-help.biz/", "qrCode": "https://untrue-lamp.info/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1740147325369", "updatedAt": "1748213037085", "projectId": ""}, {"id": "", "domain": "stale-handful.com", "key": "", "url": "https://lean-daughter.org", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1759564436734", "expiredUrl": "https://perfumed-marketplace.com/", "password": "xsCzKbmqqqJnqbw", "proxy": false, "title": "", "description": "as so yet whenever rotating hygienic mid", "image": "https://loremflickr.com/958/3484?lock=3072922795184569", "video": "https://loremflickr.com/565/2800?lock=8555441928057420", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "blue"}, {"id": "", "name": "", "color": "purple"}, {"id": "", "name": "", "color": "yellow"}], "folderId": "", "webhookIds": ["", ""], "comments": "polished whether welcome deck gratefully for outfox pfft indeed phew rejigger overcoat when wonderful ugh before however fooey weakly", "shortLink": "https://muddy-nightlife.info/", "qrCode": "https://cloudy-tackle.net/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1725236962136", "updatedAt": "1748219386012", "projectId": ""}] "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -676,7 +699,7 @@ examples: externalId: "123456" responses: "200": - application/json: {"id": "", "domain": "rural-mathematics.name", "key": "", "url": "https://willing-impostor.info", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1753489692848", "expiredUrl": "https://warm-hundred.net/", "password": "5UmEgZU18kgjdwK", "proxy": false, "title": "", "description": "aw showboat shakily times bravely quizzically", "image": "https://picsum.photos/seed/eIfMMF/2755/1170", "video": "https://loremflickr.com/754/1831?lock=3684390672984324", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "green"}, {"id": "", "name": "", "color": "yellow"}, {"id": "", "name": "", "color": "red"}], "folderId": "", "webhookIds": ["", ""], "comments": "scholarship to blink nifty generously", "shortLink": "https://spiffy-character.name/", "qrCode": "https://immediate-lounge.biz/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1727252247964", "updatedAt": "1745140876359", "projectId": ""} + application/json: {"id": "", "domain": "rural-mathematics.name", "key": "", "url": "https://willing-impostor.info", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1756547995340", "expiredUrl": "https://warm-hundred.net/", "password": "5UmEgZU18kgjdwK", "proxy": false, "title": "", "description": "aw showboat shakily times bravely quizzically", "image": "https://picsum.photos/seed/eIfMMF/2755/1170", "video": "https://loremflickr.com/754/1831?lock=3684390672984324", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "green"}, {"id": "", "name": "", "color": "yellow"}, {"id": "", "name": "", "color": "red"}], "folderId": "", "webhookIds": ["", ""], "comments": "scholarship to blink nifty generously", "shortLink": "https://spiffy-character.name/", "qrCode": "https://immediate-lounge.biz/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1730310550442", "updatedAt": "1748199178837", "projectId": ""} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -702,7 +725,7 @@ examples: linkId: "" responses: "200": - application/json: {"id": "", "domain": "tinted-nectarine.info", "key": "", "url": "https://powerless-juggernaut.org", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1746907077556", "expiredUrl": "https://juvenile-exploration.biz", "password": "kuMjbGhnJP7Bopu", "proxy": false, "title": "", "description": "bleak from that qualified cycle woot abseil perfumed", "image": "https://loremflickr.com/1166/1632?lock=5920233536834378", "video": "https://loremflickr.com/996/369?lock=4799093392417520", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "blue"}, {"id": "", "name": "", "color": "blue"}, {"id": "", "name": "", "color": "green"}], "folderId": "", "webhookIds": [], "comments": "duh clamour urgently voluntarily scale gut readies concerning statement nice consequently provided when rim league almost forenenst instead arbitrate pulse", "shortLink": "https://impossible-typeface.net/", "qrCode": "https://worthy-effector.net", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1718485510854", "updatedAt": "1745130854965", "projectId": ""} + application/json: {"id": "", "domain": "tinted-nectarine.info", "key": "", "url": "https://powerless-juggernaut.org", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1749965380024", "expiredUrl": "https://juvenile-exploration.biz", "password": "kuMjbGhnJP7Bopu", "proxy": false, "title": "", "description": "bleak from that qualified cycle woot abseil perfumed", "image": "https://loremflickr.com/1166/1632?lock=5920233536834378", "video": "https://loremflickr.com/996/369?lock=4799093392417520", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "blue"}, {"id": "", "name": "", "color": "blue"}, {"id": "", "name": "", "color": "green"}], "folderId": "", "webhookIds": [], "comments": "duh clamour urgently voluntarily scale gut readies concerning statement nice consequently provided when rim league almost forenenst instead arbitrate pulse", "shortLink": "https://impossible-typeface.net/", "qrCode": "https://worthy-effector.net", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1721543813302", "updatedAt": "1748189157412", "projectId": ""} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -751,7 +774,7 @@ examples: speakeasy-default-bulk-create-links: responses: "200": - application/json: [{"error": "", "code": "conflict"}, {"id": "", "domain": "enlightened-sanity.info", "key": "", "url": "https://flawed-plumber.name/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1765649140228", "expiredUrl": "https://devoted-quit.name", "password": "i6NXnrZ9O3zPrEC", "proxy": false, "title": "", "description": "ditch what outside monthly kielbasa psst finer aw although", "image": "https://picsum.photos/seed/rlA3LwhK/1855/1563", "video": "https://picsum.videos/seed/itt7gjdv/857/1825", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [], "folderId": "", "webhookIds": ["", "", ""], "comments": "beyond ha since pike gadzooks outside cardboard clavicle even supposing what longingly", "shortLink": "https://haunting-membership.net", "qrCode": "https://pointless-freckle.info", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1719150618562", "updatedAt": "1745174728823", "projectId": ""}] + application/json: [{"error": "", "code": "conflict"}, {"id": "", "domain": "enlightened-sanity.info", "key": "", "url": "https://flawed-plumber.name/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1768707442658", "expiredUrl": "https://devoted-quit.name", "password": "i6NXnrZ9O3zPrEC", "proxy": false, "title": "", "description": "ditch what outside monthly kielbasa psst finer aw although", "image": "https://picsum.photos/seed/rlA3LwhK/1855/1563", "video": "https://picsum.videos/seed/itt7gjdv/857/1825", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [], "folderId": "", "webhookIds": ["", "", ""], "comments": "beyond ha since pike gadzooks outside cardboard clavicle even supposing what longingly", "shortLink": "https://haunting-membership.net", "qrCode": "https://pointless-freckle.info", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1722208920962", "updatedAt": "1748233031222", "projectId": ""}] "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -774,7 +797,7 @@ examples: speakeasy-default-bulk-update-links: responses: "200": - application/json: [{"id": "", "domain": "old-lox.org", "key": "", "url": "https://angelic-cellar.org/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1754728710219", "expiredUrl": "https://yellowish-vicinity.org/", "password": "yMRdLF0naLtN5wK", "proxy": false, "title": "", "description": "aboard octave since", "image": "https://loremflickr.com/2247/3258?lock=8204630610718424", "video": "https://picsum.videos/seed/L7W1CltA/399/207", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "green"}, {"id": "", "name": "", "color": "blue"}], "folderId": "", "webhookIds": ["", "", ""], "comments": "psst instead even brr react busily both along whereas absent why round around round beneficial however safely defensive", "shortLink": "https://inborn-trick.biz", "qrCode": "https://scientific-alliance.biz/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1731220663759", "updatedAt": "1745179119984", "projectId": ""}, {"id": "", "domain": "purple-secrecy.name", "key": "", "url": "https://unwilling-godparent.biz/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1769744452954", "expiredUrl": "https://weekly-formamide.name", "password": "t3Ls5KHqWZvIT9U", "proxy": false, "title": "", "description": "tribe astonishing hm who blah verify soybean", "image": "https://picsum.photos/seed/DauITRrHdo/3783/3955", "video": "https://loremflickr.com/405/3655?lock=8436311567525016", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "green"}, {"id": "", "name": "", "color": "purple"}, {"id": "", "name": "", "color": "pink"}], "folderId": "", "webhookIds": [""], "comments": "since cloudy dutiful heartache unto yippee custom footrest forenenst astonishing shore", "shortLink": "https://exotic-hydrolyze.name/", "qrCode": "https://giving-scale.name", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1723835311463", "updatedAt": "1745135057342", "projectId": ""}] + application/json: [{"id": "", "domain": "old-lox.org", "key": "", "url": "https://angelic-cellar.org/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1757787012592", "expiredUrl": "https://yellowish-vicinity.org/", "password": "yMRdLF0naLtN5wK", "proxy": false, "title": "", "description": "aboard octave since", "image": "https://loremflickr.com/2247/3258?lock=8204630610718424", "video": "https://picsum.videos/seed/L7W1CltA/399/207", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "green"}, {"id": "", "name": "", "color": "blue"}], "folderId": "", "webhookIds": ["", "", ""], "comments": "psst instead even brr react busily both along whereas absent why round around round beneficial however safely defensive", "shortLink": "https://inborn-trick.biz", "qrCode": "https://scientific-alliance.biz/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1734278966122", "updatedAt": "1748237422347", "projectId": ""}, {"id": "", "domain": "purple-secrecy.name", "key": "", "url": "https://unwilling-godparent.biz/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1772802755315", "expiredUrl": "https://weekly-formamide.name", "password": "t3Ls5KHqWZvIT9U", "proxy": false, "title": "", "description": "tribe astonishing hm who blah verify soybean", "image": "https://picsum.photos/seed/DauITRrHdo/3783/3955", "video": "https://loremflickr.com/405/3655?lock=8436311567525016", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "green"}, {"id": "", "name": "", "color": "purple"}, {"id": "", "name": "", "color": "pink"}], "folderId": "", "webhookIds": [""], "comments": "since cloudy dutiful heartache unto yippee custom footrest forenenst astonishing shore", "shortLink": "https://exotic-hydrolyze.name/", "qrCode": "https://giving-scale.name", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1726893613813", "updatedAt": "1748193359693", "projectId": ""}] "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -823,7 +846,7 @@ examples: speakeasy-default-upsert-link: responses: "200": - application/json: {"id": "", "domain": "neat-instruction.info", "key": "", "url": "https://entire-rubric.com/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1749835696638", "expiredUrl": "https://rubbery-lay.com/", "password": "cHWcftWRnnmyj_U", "proxy": false, "title": "", "description": "likewise concerning annual instantly anti deployment", "image": "https://loremflickr.com/181/3306?lock=1275456187971812", "video": "https://picsum.videos/seed/CcMAI/2638/2080", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "pink"}, {"id": "", "name": "", "color": "purple"}, {"id": "", "name": "", "color": "red"}], "folderId": "", "webhookIds": [], "comments": "clueless unless conclude daddy boohoo ideal lumpy masculinize charter geez as eulogise granny", "shortLink": "https://complicated-resource.net/", "qrCode": "https://impractical-cap.net", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1739590413990", "updatedAt": "1745168300206", "projectId": ""} + application/json: {"id": "", "domain": "neat-instruction.info", "key": "", "url": "https://entire-rubric.com/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1752893998979", "expiredUrl": "https://rubbery-lay.com/", "password": "cHWcftWRnnmyj_U", "proxy": false, "title": "", "description": "likewise concerning annual instantly anti deployment", "image": "https://loremflickr.com/181/3306?lock=1275456187971812", "video": "https://picsum.videos/seed/CcMAI/2638/2080", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "pink"}, {"id": "", "name": "", "color": "purple"}, {"id": "", "name": "", "color": "red"}], "folderId": "", "webhookIds": [], "comments": "clueless unless conclude daddy boohoo ideal lumpy masculinize charter geez as eulogise granny", "shortLink": "https://complicated-resource.net/", "qrCode": "https://impractical-cap.net", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1742648716320", "updatedAt": "1748226602536", "projectId": ""} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -857,7 +880,7 @@ examples: refererUrl: "https://dub.co/blog" responses: "200": - application/json: [{"country": "GE", "region": "*", "city": "North Kailee", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}, {"country": "PH", "region": "*", "city": "Port Anabelfort", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}, {"country": "VN", "region": "*", "city": "East Anissafurt", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}] + application/json: [{"country": "GE", "region": "", "city": "North Kailee", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}, {"country": "PH", "region": "", "city": "Port Anabelfort", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}, {"country": "VN", "region": "", "city": "East Anissafurt", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}] "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -881,7 +904,6 @@ examples: parameters: query: event: "clicks" - interval: "24h" timezone: "America/New_York" city: "New York" device: "Desktop" @@ -895,7 +917,7 @@ examples: sortBy: "timestamp" responses: "200": - application/json: [{"event": "sale", "timestamp": "", "eventId": "", "eventName": "", "link": {"id": "", "domain": "remorseful-concentration.biz", "key": "", "url": "https://primary-paintwork.com/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": true, "expiresAt": "1748133366528", "expiredUrl": "https://memorable-overcoat.com", "password": "COyVtOrvIw1vLIJ", "proxy": true, "title": "", "description": "cleverly blossom defiantly", "image": "https://picsum.photos/seed/FhMx4/296/3347", "video": "https://picsum.videos/seed/gk5Gr0OXM/244/1177", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [], "folderId": "", "webhookIds": [""], "comments": "eek censor tenement commonly softly boo massive sorrowful aw strict behind along energetic oddball pasta thread vestment meanwhile likely up", "shortLink": "https://lucky-volleyball.biz", "qrCode": "https://discrete-omelet.net/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "testStartedAt": "", "testCompletedAt": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1742101222652", "updatedAt": "1745952913664", "projectId": ""}, "click": {"id": "", "timestamp": "", "url": "https://watery-ecliptic.info/", "country": "Somalia", "city": "Jammiecester", "region": "", "continent": "Antarctica", "device": "Mobile", "browser": "Firefox", "os": "BeOS", "referer": "male-widow.info", "refererUrl": "https://sticky-tune-up.net", "qr": true, "ip": "144.175.252.47"}, "customer": {"id": "", "externalId": "", "name": "", "createdAt": "1716443409006"}, "sale": {"amount": 608798, "invoiceId": null, "paymentProcessor": "shopify"}, "saleAmount": 8727.59, "invoice_id": "", "payment_processor": "", "click_id": "", "link_id": "", "domain": "hateful-linseed.info", "key": "", "url": "https://rowdy-cuckoo.org/", "continent": "South America", "country": "Georgia", "city": "Emanuelboro", "device": "Mobile", "browser": "Chrome", "os": "WebOS", "qr": 3279.73, "ip": "16.166.150.33"}, {"event": "sale", "timestamp": "", "eventId": "", "eventName": "", "link": {"id": "", "domain": "sparkling-hydrolyze.biz", "key": "", "url": "https://closed-space.org/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": true, "expiresAt": "1764217330103", "expiredUrl": "https://unkempt-conversation.com/", "password": "PMbm9rjvofBDkNA", "proxy": false, "title": "", "description": "after although while", "image": "https://picsum.photos/seed/Z9T8xoAjNE/354/1907", "video": "https://loremflickr.com/1063/1000?lock=6552935322217005", "rewrite": true, "doIndex": true, "ios": "", "android": "", "geo": {}, "publicStats": true, "tagId": "", "tags": [{"id": "", "name": "", "color": "pink"}], "folderId": "", "webhookIds": [], "comments": "clear-cut an mid aw disconnection which wetly typeface usable underneath putrefy ah aha joint careless whoever yesterday thorny unwelcome", "shortLink": "https://upbeat-sermon.org", "qrCode": "https://plump-horde.com", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "testStartedAt": "", "testCompletedAt": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1722349814880", "updatedAt": "1745946060353", "projectId": ""}, "click": {"id": "", "timestamp": "", "url": "https://lined-address.name/", "country": "Moldova", "city": "Dachfield", "region": "", "continent": "Africa", "device": "Desktop", "browser": "Firefox", "os": "Symbian", "referer": "fatherly-marketplace.biz", "refererUrl": "https://bitter-platter.net/", "qr": false, "ip": "adca:ffa9:74d9:bf7c:f4c5:d273:f1ed:be4f"}, "customer": {"id": "", "externalId": "", "name": "", "createdAt": "1743562522580"}, "sale": {"amount": 478369, "invoiceId": null, "paymentProcessor": "custom"}, "saleAmount": 3702.47, "invoice_id": "", "payment_processor": "", "click_id": "", "link_id": "", "domain": "untimely-straw.net", "key": "", "url": "https://definitive-cutover.com", "continent": "Africa", "country": "Angola", "city": "Ryleyport", "device": "Desktop", "browser": "Firefox", "os": "Android", "qr": 9298.29, "ip": "250.239.120.52"}] + application/json: [{"event": "lead", "timestamp": "", "eventId": "", "eventName": "", "click": {"id": "", "timestamp": "", "url": "https://definite-deer.com", "country": "New Zealand", "city": "Auercester", "region": "", "continent": "Africa", "device": "Desktop", "browser": "Safari", "os": "Chrome OS", "referer": "pricey-accountability.com", "refererUrl": "https://lovely-bench.org/", "qr": false, "ip": "a17c:0d9e:31d2:a99a:2bc9:c682:3e0d:ee1f"}, "link": {"id": "", "domain": "odd-spork.net", "key": "", "url": "https://bossy-coliseum.com", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1752731153489", "expiredUrl": "https://fond-scale.name", "password": "h9aKnjQvMfiGbZG", "proxy": true, "title": "", "description": "woot excepting gah only despite seemingly eventually ah creative", "image": "https://picsum.photos/seed/ulbP1D/1921/2957", "video": "https://picsum.videos/seed/rwTe8z/373/1885", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "blue"}, {"id": "", "name": "", "color": "blue"}, {"id": "", "name": "", "color": "purple"}], "folderId": "", "webhookIds": [], "comments": "validity yuck until midst taxicab describe house what married owlishly which wonderfully CD", "shortLink": "https://good-natured-fundraising.com", "qrCode": "https://outstanding-celsius.net", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "testStartedAt": "", "testCompletedAt": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1730807151977", "updatedAt": "1748197397324", "projectId": ""}, "customer": {"id": "", "externalId": "", "name": "", "createdAt": "1723404805872"}, "click_id": "", "link_id": "", "domain": "closed-space.org", "key": "", "url": "https://brave-mixture.biz", "continent": "South America", "country": "Christmas Island", "city": "South Jamarcuschester", "device": "Mobile", "browser": "Chrome", "os": "WebOS", "qr": 2601.25, "ip": "12bd:ca78:ba26:7f0c:aeae:50ec:495f:0bad"}, {"event": "sale", "timestamp": "", "eventId": "", "eventName": "", "link": {"id": "", "domain": "cheerful-operating.org", "key": "", "url": "https://live-plumber.org/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": true, "expiresAt": "1776373151071", "expiredUrl": "https://natural-government.name/", "password": "l_88fquzaxdapYd", "proxy": true, "title": "", "description": "um what thump kettledrum configuration esteemed mysteriously legend absent", "image": "https://loremflickr.com/2620/816?lock=1054946459216100", "video": "https://loremflickr.com/1458/3724?lock=2702374725680927", "rewrite": false, "doIndex": true, "ios": "", "android": "", "geo": {}, "publicStats": true, "tagId": "", "tags": [], "folderId": "", "webhookIds": ["", "", ""], "comments": "mid next dearly competent tender right plump address loosely bathhouse nifty for second", "shortLink": "https://next-design.org/", "qrCode": "https://grouchy-characterization.net/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "testStartedAt": "", "testCompletedAt": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1718709759680", "updatedAt": "1748256139901", "projectId": ""}, "click": {"id": "", "timestamp": "", "url": "https://menacing-peony.biz", "country": "Philippines", "city": "Largo", "region": "", "continent": "South America", "device": "Desktop", "browser": "Safari", "os": "BeOS", "referer": "splendid-octave.biz", "refererUrl": "https://cluttered-character.com/", "qr": false, "ip": "a587:e2fe:a4f0:3421:4146:6e5a:de54:29e8"}, "customer": {"id": "", "externalId": "", "name": "", "createdAt": "1739098781475"}, "sale": {"amount": 543675, "invoiceId": null, "paymentProcessor": "polar"}, "saleAmount": 7354.65, "invoice_id": "", "payment_processor": "", "click_id": "", "link_id": "", "domain": "improbable-hawk.name", "key": "", "url": "https://pleasing-distinction.org/", "continent": "Asia", "country": "Svalbard & Jan Mayen Islands", "city": "South Catherine", "device": "Desktop", "browser": "Firefox", "os": "WebOS", "qr": 732.15, "ip": "31.8.195.23"}, {"event": "sale", "timestamp": "", "eventId": "", "eventName": "", "link": {"id": "", "domain": "feline-planula.name", "key": "", "url": "https://scared-discourse.com", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": true, "expiresAt": "1761735704827", "expiredUrl": "https://pricey-assist.org/", "password": "DNBiqNvvR9DIi2U", "proxy": true, "title": "", "description": "generously forgo powerfully aw ew", "image": "https://loremflickr.com/2098/684?lock=240420111853983", "video": "https://loremflickr.com/2652/791?lock=862872020558869", "rewrite": true, "doIndex": true, "ios": "", "android": "", "geo": {}, "publicStats": true, "tagId": "", "tags": [], "folderId": "", "webhookIds": [""], "comments": "mid impressionable jovially hm against descent yum recommendation nerve ah book validity notwithstanding unaccountably ah hmph truthfully whup politely", "shortLink": "https://sneaky-freight.name", "qrCode": "https://serpentine-summer.name", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "testStartedAt": "", "testCompletedAt": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1720157115800", "updatedAt": "1748233289977", "projectId": ""}, "click": {"id": "", "timestamp": "", "url": "https://clueless-fisherman.net/", "country": "Cameroon", "city": "Mosciskibury", "region": "", "continent": "Europe", "device": "Mobile", "browser": "Firefox", "os": "MacOS", "referer": "sniveling-seafood.org", "refererUrl": "https://unlined-hunger.name/", "qr": false, "ip": "53.34.214.95"}, "customer": {"id": "", "externalId": "", "name": "", "createdAt": "1725944885688"}, "sale": {"amount": 484583, "invoiceId": null, "paymentProcessor": "shopify"}, "saleAmount": 7737.22, "invoice_id": "", "payment_processor": "", "click_id": "", "link_id": "", "domain": "possible-address.biz", "key": "", "url": "https://tiny-premium.biz/", "continent": "Australia", "country": "Rwanda", "city": "Robertborough", "device": "Desktop", "browser": "Chrome", "os": "BeOS", "qr": 9191.11, "ip": "e5e5:5ac4:fd87:7c7d:4735:ab6e:64a1:5abd"}] "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1022,7 +1044,7 @@ examples: speakeasy-default-create-folder: responses: "201": - application/json: {"id": "", "name": "", "type": "default", "accessLevel": null, "linkCount": 0, "createdAt": "1733799507447", "updatedAt": "1745151840025"} + application/json: {"id": "", "name": "", "type": "default", "accessLevel": null, "linkCount": 0, "createdAt": "1736857809681", "updatedAt": "1748210142259"} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1049,7 +1071,7 @@ examples: pageSize: 50 responses: "200": - application/json: [{"id": "", "name": "", "type": "mega", "accessLevel": null, "linkCount": 0, "createdAt": "1735057556063", "updatedAt": "1745131125769"}, {"id": "", "name": "", "type": "default", "accessLevel": null, "linkCount": 0, "createdAt": "1718486059564", "updatedAt": "1745170681461"}, {"id": "", "name": "", "type": "mega", "accessLevel": null, "linkCount": 0, "createdAt": "1714220493247", "updatedAt": "1745177832784"}] + application/json: [{"id": "", "name": "", "type": "mega", "accessLevel": null, "linkCount": 0, "createdAt": "1738115858290", "updatedAt": "1748189427996"}, {"id": "", "name": "", "type": "default", "accessLevel": null, "linkCount": 0, "createdAt": "1721544361791", "updatedAt": "1748228983688"}, {"id": "", "name": "", "type": "mega", "accessLevel": null, "linkCount": 0, "createdAt": "1717278795473", "updatedAt": "1748236135010"}] "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1075,7 +1097,7 @@ examples: id: "" responses: "200": - application/json: {"id": "", "name": "", "type": "mega", "accessLevel": null, "linkCount": 0, "createdAt": "1732497228221", "updatedAt": "1745145546942"} + application/json: {"id": "", "name": "", "type": "mega", "accessLevel": null, "linkCount": 0, "createdAt": "1735555530440", "updatedAt": "1748203849161"} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1124,7 +1146,7 @@ examples: speakeasy-default-create-domain: responses: "201": - application/json: {"id": "", "slug": "acme.com", "verified": false, "primary": false, "archived": false, "placeholder": "https://dub.co/help/article/what-is-dub", "expiredUrl": "https://acme.com/expired", "notFoundUrl": "https://acme.com/not-found", "assetLinks": null, "appleAppSiteAssociation": null, "logo": "", "createdAt": "1729011256337", "updatedAt": "1745170931342", "registeredDomain": {"id": "", "createdAt": "1726831119706", "expiresAt": "1749439510895"}} + application/json: {"id": "", "slug": "acme.com", "verified": false, "primary": false, "archived": false, "placeholder": "https://dub.co/help/article/what-is-dub", "expiredUrl": "https://acme.com/expired", "notFoundUrl": "https://acme.com/not-found", "assetLinks": null, "appleAppSiteAssociation": null, "logo": "", "createdAt": "1732069558543", "updatedAt": "1748229233546", "registeredDomain": {"id": "", "createdAt": "1729889421910", "expiresAt": "1752497813099"}} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1152,7 +1174,7 @@ examples: pageSize: 50 responses: "200": - application/json: [{"id": "", "slug": "acme.com", "verified": false, "primary": false, "archived": false, "placeholder": "https://dub.co/help/article/what-is-dub", "expiredUrl": "https://acme.com/expired", "notFoundUrl": "https://acme.com/not-found", "assetLinks": null, "appleAppSiteAssociation": null, "logo": "", "createdAt": "1730924937145", "updatedAt": "1745174378027", "registeredDomain": {"id": "", "createdAt": "1719270323225", "expiresAt": "1752446520085"}}, {"id": "", "slug": "acme.com", "verified": false, "primary": false, "archived": false, "placeholder": "https://dub.co/help/article/what-is-dub", "expiredUrl": "https://acme.com/expired", "notFoundUrl": "https://acme.com/not-found", "assetLinks": null, "appleAppSiteAssociation": null, "logo": "", "createdAt": "1718486059629", "updatedAt": "1745170681526", "registeredDomain": {"id": "", "createdAt": "1733829869588", "expiresAt": "1745756494312"}}, {"id": "", "slug": "acme.com", "verified": false, "primary": false, "archived": false, "placeholder": "https://dub.co/help/article/what-is-dub", "expiredUrl": "https://acme.com/expired", "notFoundUrl": "https://acme.com/not-found", "assetLinks": null, "appleAppSiteAssociation": null, "logo": "", "createdAt": "1736318579872", "updatedAt": "1745123214586", "registeredDomain": {"id": "", "createdAt": "1715826539230", "expiresAt": "1766897667864"}}] + application/json: [{"id": "", "slug": "acme.com", "verified": false, "primary": false, "archived": false, "placeholder": "https://dub.co/help/article/what-is-dub", "expiredUrl": "https://acme.com/expired", "notFoundUrl": "https://acme.com/not-found", "assetLinks": null, "appleAppSiteAssociation": null, "logo": "", "createdAt": "1733983239342", "updatedAt": "1748232680224", "registeredDomain": {"id": "", "createdAt": "1722328625421", "expiresAt": "1755504822281"}}, {"id": "", "slug": "acme.com", "verified": false, "primary": false, "archived": false, "placeholder": "https://dub.co/help/article/what-is-dub", "expiredUrl": "https://acme.com/expired", "notFoundUrl": "https://acme.com/not-found", "assetLinks": null, "appleAppSiteAssociation": null, "logo": "", "createdAt": "1721544361826", "updatedAt": "1748228983723", "registeredDomain": {"id": "", "createdAt": "1736888171784", "expiresAt": "1748814796508"}}, {"id": "", "slug": "acme.com", "verified": false, "primary": false, "archived": false, "placeholder": "https://dub.co/help/article/what-is-dub", "expiredUrl": "https://acme.com/expired", "notFoundUrl": "https://acme.com/not-found", "assetLinks": null, "appleAppSiteAssociation": null, "logo": "", "createdAt": "1739376882068", "updatedAt": "1748181516782", "registeredDomain": {"id": "", "createdAt": "1718884841425", "expiresAt": "1769955970059"}}] "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1178,7 +1200,7 @@ examples: slug: "acme.com" responses: "200": - application/json: {"id": "", "slug": "acme.com", "verified": false, "primary": false, "archived": false, "placeholder": "https://dub.co/help/article/what-is-dub", "expiredUrl": "https://acme.com/expired", "notFoundUrl": "https://acme.com/not-found", "assetLinks": null, "appleAppSiteAssociation": null, "logo": "", "createdAt": "1740707572178", "updatedAt": "1745167363530", "registeredDomain": {"id": "", "createdAt": "1724534105884", "expiresAt": "1776468973338"}} + application/json: {"id": "", "slug": "acme.com", "verified": false, "primary": false, "archived": false, "placeholder": "https://dub.co/help/article/what-is-dub", "expiredUrl": "https://acme.com/expired", "notFoundUrl": "https://acme.com/not-found", "assetLinks": null, "appleAppSiteAssociation": null, "logo": "", "createdAt": "1743765874366", "updatedAt": "1748225665718", "registeredDomain": {"id": "", "createdAt": "1727592408072", "expiresAt": "1779527275525"}} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1273,11 +1295,13 @@ examples: speakeasy-default-get-customers: parameters: query: + sortBy: "createdAt" + sortOrder: "desc" page: 1 pageSize: 50 responses: "200": - application/json: [{"id": "", "externalId": "", "name": "", "createdAt": "1730924937228"}, {"id": "", "externalId": "", "name": "", "createdAt": "1735057556211"}, {"id": "", "externalId": "", "name": "", "createdAt": "1719270323308"}] + application/json: [{"id": "", "externalId": "", "name": "", "createdAt": "1733983239386"}, {"id": "", "externalId": "", "name": "", "createdAt": "1738115858368"}, {"id": "", "externalId": "", "name": "", "createdAt": "1722328625466"}] "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1300,7 +1324,7 @@ examples: speakeasy-default-create-customer: responses: "201": - application/json: {"id": "", "externalId": "", "name": "", "createdAt": "1729011256454"} + application/json: {"id": "", "externalId": "", "name": "", "createdAt": "1732069558605"} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1327,7 +1351,7 @@ examples: query: {} responses: "200": - application/json: {"id": "", "externalId": "", "name": "", "createdAt": "1735752297882"} + application/json: {"id": "", "externalId": "", "name": "", "createdAt": "1738810600025"} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1354,7 +1378,7 @@ examples: query: {} responses: "200": - application/json: {"id": "", "externalId": "", "name": "", "createdAt": "1740707572292"} + application/json: {"id": "", "externalId": "", "name": "", "createdAt": "1743765874427"} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1403,7 +1427,7 @@ examples: speakeasy-default-create-partner: responses: "201": - application/json: {"id": "", "name": "", "email": "Loyal79@yahoo.com", "image": "https://loremflickr.com/1/679?lock=7139282333236917", "country": "Slovenia", "paypalEmail": "", "stripeConnectId": "", "payoutsEnabledAt": "", "createdAt": "1732153215847", "status": "declined", "programId": "", "tenantId": "", "links": [{"id": "", "domain": "harmful-disposer.com", "key": "", "shortLink": "https://each-barracks.biz/", "url": "https://blind-breastplate.name/", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}, {"id": "", "domain": "gripping-analogy.name", "key": "", "shortLink": "https://distant-advertisement.name", "url": "https://quick-witted-march.org/", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}, {"id": "", "domain": "kooky-kinase.biz", "key": "", "shortLink": "https://considerate-pressure.org", "url": "https://smooth-dash.info", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}], "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0, "earnings": 0} + application/json: {"id": "", "name": "", "email": "Loyal79@yahoo.com", "image": "https://loremflickr.com/1/679?lock=7139282333236917", "country": "Slovenia", "website": "", "youtube": "", "twitter": "", "linkedin": "", "instagram": "", "tiktok": "", "paypalEmail": "", "stripeConnectId": "", "payoutsEnabledAt": "", "createdAt": "1735211517968", "status": "declined", "programId": "", "tenantId": "", "links": [{"id": "", "domain": "harmful-disposer.com", "key": "", "shortLink": "https://each-barracks.biz/", "url": "https://blind-breastplate.name/", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}, {"id": "", "domain": "gripping-analogy.name", "key": "", "shortLink": "https://distant-advertisement.name", "url": "https://quick-witted-march.org/", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}, {"id": "", "domain": "kooky-kinase.biz", "key": "", "shortLink": "https://considerate-pressure.org", "url": "https://smooth-dash.info", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0}], "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0, "earnings": 0} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1426,7 +1450,7 @@ examples: speakeasy-default-create-partner-link: responses: "201": - application/json: {"id": "", "domain": "tall-making.com", "key": "", "url": "https://inferior-louse.org", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1767064420295", "expiredUrl": "https://tragic-skean.biz/", "password": "kPhoCRFmmigZdFo", "proxy": false, "title": "", "description": "miserably merrily stay ouch", "image": "https://picsum.photos/seed/tXRBthjAFj/215/2959", "video": "https://loremflickr.com/3827/1329?lock=4742285326014076", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "purple"}, {"id": "", "name": "", "color": "pink"}, {"id": "", "name": "", "color": "red"}], "folderId": "", "webhookIds": ["", ""], "comments": "numb worriedly tinted nor utterly but meh worriedly gadzooks poorly afterwards whether penalise before academics nicely ugh whistle hungrily", "shortLink": "https://likely-submitter.info/", "qrCode": "https://plain-cafe.org", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1728120688101", "updatedAt": "1745166802900", "projectId": ""} + application/json: {"id": "", "domain": "tall-making.com", "key": "", "url": "https://inferior-louse.org", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1770122722400", "expiredUrl": "https://tragic-skean.biz/", "password": "kPhoCRFmmigZdFo", "proxy": false, "title": "", "description": "miserably merrily stay ouch", "image": "https://picsum.photos/seed/tXRBthjAFj/215/2959", "video": "https://loremflickr.com/3827/1329?lock=4742285326014076", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "purple"}, {"id": "", "name": "", "color": "pink"}, {"id": "", "name": "", "color": "red"}], "folderId": "", "webhookIds": ["", ""], "comments": "numb worriedly tinted nor utterly but meh worriedly gadzooks poorly afterwards whether penalise before academics nicely ugh whistle hungrily", "shortLink": "https://likely-submitter.info/", "qrCode": "https://plain-cafe.org", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1731178990195", "updatedAt": "1748225104994", "projectId": ""} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1475,7 +1499,7 @@ examples: speakeasy-default-upsert-partner-link: responses: "200": - application/json: {"id": "", "domain": "internal-teriyaki.name", "key": "", "url": "https://snoopy-exasperation.name/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1749718681016", "expiredUrl": "https://trim-stump.org/", "password": "aeFj89Olng6LL82", "proxy": false, "title": "", "description": "next assail unblinking gulp doting selfishly resource poppy scent", "image": "https://loremflickr.com/1169/3796?lock=7016484909038829", "video": "https://loremflickr.com/476/1877?lock=724230151067151", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [], "folderId": "", "webhookIds": [""], "comments": "ick yippee unit train fashion up out er confound redevelop", "shortLink": "https://tense-interchange.com/", "qrCode": "https://uncommon-accelerator.net/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1742078907705", "updatedAt": "1745166837538", "projectId": ""} + application/json: {"id": "", "domain": "internal-teriyaki.name", "key": "", "url": "https://snoopy-exasperation.name/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1752776983087", "expiredUrl": "https://trim-stump.org/", "password": "aeFj89Olng6LL82", "proxy": false, "title": "", "description": "next assail unblinking gulp doting selfishly resource poppy scent", "image": "https://loremflickr.com/1169/3796?lock=7016484909038829", "video": "https://loremflickr.com/476/1877?lock=724230151067151", "rewrite": false, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [], "folderId": "", "webhookIds": [""], "comments": "ick yippee unit train fashion up out er confound redevelop", "shortLink": "https://tense-interchange.com/", "qrCode": "https://uncommon-accelerator.net/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 0, "lastClicked": "", "leads": 0, "sales": 0, "saleAmount": 0, "createdAt": "1745137209762", "updatedAt": "1748225139595", "projectId": ""} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1503,7 +1527,37 @@ examples: programId: "" responses: "200": - application/json: [{"link": "", "id": "", "domain": "hot-dandelion.org", "key": "", "shortLink": "", "url": "https://everlasting-cheetah.name", "createdAt": "1718731996662", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0, "earnings": 0}, {"link": "", "id": "", "domain": "grizzled-ecliptic.biz", "key": "", "shortLink": "", "url": "https://possible-interchange.info", "createdAt": "1744656764922", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0, "earnings": 0}, {"link": "", "id": "", "domain": "glass-wriggler.biz", "key": "", "shortLink": "", "url": "https://light-fit.name/", "createdAt": "1716287275442", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0, "earnings": 0}] + application/json: [{"link": "", "id": "", "domain": "hot-dandelion.org", "key": "", "shortLink": "", "url": "https://everlasting-cheetah.name", "createdAt": "1721790298704", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0, "earnings": 0}, {"link": "", "id": "", "domain": "grizzled-ecliptic.biz", "key": "", "shortLink": "", "url": "https://possible-interchange.info", "createdAt": "1747715066956", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0, "earnings": 0}, {"link": "", "id": "", "domain": "glass-wriggler.biz", "key": "", "shortLink": "", "url": "https://light-fit.name/", "createdAt": "1719345577464", "clicks": 0, "leads": 0, "sales": 0, "saleAmount": 0, "earnings": 0}] + "400": + application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} + "401": + application/json: {"error": {"code": "unauthorized", "message": "The requested resource was not found."}} + "403": + application/json: {"error": {"code": "forbidden", "message": "The requested resource was not found."}} + "404": + application/json: {"error": {"code": "not_found", "message": "The requested resource was not found."}} + "409": + application/json: {"error": {"code": "conflict", "message": "The requested resource was not found."}} + "410": + application/json: {"error": {"code": "invite_expired", "message": "The requested resource was not found."}} + "422": + application/json: {"error": {"code": "unprocessable_entity", "message": "The requested resource was not found."}} + "429": + application/json: {"error": {"code": "rate_limit_exceeded", "message": "The requested resource was not found."}} + "500": + application/json: {"error": {"code": "internal_server_error", "message": "The requested resource was not found."}} + listCommissions: + speakeasy-default-list-commissions: + parameters: + query: + sortBy: "createdAt" + sortOrder: "desc" + interval: "all" + page: 1 + pageSize: 50 + responses: + "200": + application/json: [{"id": "cm_1JVR7XRCSR0EDBAF39FZ4PMYE", "amount": 5472.72, "earnings": 6783.17, "currency": "Chilean Peso", "status": "processed", "createdAt": "1721544361990", "updatedAt": "1748228983887"}, {"id": "cm_1JVR7XRCSR0EDBAF39FZ4PMYE", "amount": 6393.87, "earnings": 175.77, "currency": "Russian Ruble", "status": "pending", "createdAt": "1718884841589", "updatedAt": "1748233513560"}, {"id": "cm_1JVR7XRCSR0EDBAF39FZ4PMYE", "amount": 5098.83, "earnings": 6339.11, "currency": "Afghani", "status": "pending", "createdAt": "1728321680473", "updatedAt": "1748216041030"}] "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1522,11 +1576,14 @@ examples: application/json: {"error": {"code": "rate_limit_exceeded", "message": "The requested resource was not found."}} "500": application/json: {"error": {"code": "internal_server_error", "message": "The requested resource was not found."}} - updatePartnerSale: - speakeasy-default-update-partner-sale: + updateCommission: + speakeasy-default-update-commission: + parameters: + path: + id: "cm_1JVR7XRCSR0EDBAF39FZ4PMYE" responses: "200": - application/json: {"id": "", "amount": 1560.34, "earnings": 2256.73, "currency": "Cayman Islands Dollar", "status": "pending", "createdAt": "1733602681459", "updatedAt": "1745121352386"} + application/json: {"id": "cm_1JVR7XRCSR0EDBAF39FZ4PMYE", "amount": 8574.78, "earnings": 5971.29, "currency": "Lempira", "status": "canceled", "createdAt": "1736519295893", "updatedAt": "1748216310902"} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1552,7 +1609,7 @@ examples: idOrSlug: "" responses: "200": - application/json: {"id": "", "name": "", "slug": "", "logo": null, "inviteCode": "", "plan": "business max", "stripeId": "", "billingCycleStart": 5588.34, "paymentFailedAt": "", "stripeConnectId": "", "totalLinks": 5442.21, "usage": 5212.35, "usageLimit": 9699.61, "linksUsage": 4580.49, "linksLimit": 4508.24, "salesUsage": 2627.95, "salesLimit": 2134.57, "domainsLimit": 9371.46, "tagsLimit": 4381.42, "foldersUsage": 8013.73, "foldersLimit": 788.88, "usersLimit": 2199.56, "aiUsage": 3134.64, "aiLimit": 945.89, "conversionEnabled": false, "dotLinkClaimed": false, "partnersEnabled": true, "createdAt": "1737210463283", "users": [{"role": "member", "defaultFolderId": ""}, {"role": "owner", "defaultFolderId": ""}], "domains": [{"slug": "acme.com", "primary": false, "verified": false}], "store": {"key": "", "key1": ""}, "allowedHostnames": ["dub.sh"]} + application/json: {"id": "", "name": "", "slug": "", "logo": null, "inviteCode": "", "plan": "business max", "stripeId": "", "billingCycleStart": 5588.34, "paymentFailedAt": "", "stripeConnectId": "", "totalLinks": 5442.21, "usage": 5212.35, "usageLimit": 9699.61, "linksUsage": 4580.49, "linksLimit": 4508.24, "salesUsage": 2627.95, "salesLimit": 2134.57, "domainsLimit": 9371.46, "tagsLimit": 4381.42, "foldersUsage": 8013.73, "foldersLimit": 788.88, "usersLimit": 2199.56, "aiUsage": 3134.64, "aiLimit": 945.89, "conversionEnabled": false, "dotLinkClaimed": false, "partnersEnabled": true, "createdAt": "1740268765284", "users": [{"role": "member", "defaultFolderId": ""}, {"role": "owner", "defaultFolderId": ""}], "domains": [{"slug": "acme.com", "primary": false, "verified": false}], "allowedHostnames": ["dub.sh"]} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1578,7 +1635,7 @@ examples: idOrSlug: "" responses: "200": - application/json: {"id": "", "name": "", "slug": "", "logo": null, "inviteCode": "", "plan": "advanced", "stripeId": "", "billingCycleStart": 5971.29, "paymentFailedAt": "", "stripeConnectId": "", "totalLinks": 3446.2, "usage": 9914.64, "usageLimit": 6276.9, "linksUsage": 4888.52, "linksLimit": 9840.08, "salesUsage": 540.62, "salesLimit": 8965.01, "domainsLimit": 4468.63, "tagsLimit": 3115.07, "foldersUsage": 2494.4, "foldersLimit": 1395.79, "usersLimit": 7892.75, "aiUsage": 8898.38, "aiLimit": 3024.61, "conversionEnabled": true, "dotLinkClaimed": false, "partnersEnabled": false, "createdAt": "1726415064687", "users": [], "domains": [{"slug": "acme.com", "primary": false, "verified": false}, {"slug": "acme.com", "primary": false, "verified": false}, {"slug": "acme.com", "primary": false, "verified": false}], "store": {"key": "", "key1": "", "key2": ""}, "allowedHostnames": ["dub.sh"]} + application/json: {"id": "", "name": "", "slug": "", "logo": null, "inviteCode": "", "plan": "advanced", "stripeId": "", "billingCycleStart": 5971.29, "paymentFailedAt": "", "stripeConnectId": "", "totalLinks": 3446.2, "usage": 9914.64, "usageLimit": 6276.9, "linksUsage": 4888.52, "linksLimit": 9840.08, "salesUsage": 540.62, "salesLimit": 8965.01, "domainsLimit": 4468.63, "tagsLimit": 3115.07, "foldersUsage": 2494.4, "foldersLimit": 1395.79, "usersLimit": 7892.75, "aiUsage": 8898.38, "aiLimit": 3024.61, "conversionEnabled": true, "dotLinkClaimed": false, "partnersEnabled": false, "createdAt": "1729473366680", "users": [], "domains": [{"slug": "acme.com", "primary": false, "verified": false}, {"slug": "acme.com", "primary": false, "verified": false}, {"slug": "acme.com", "primary": false, "verified": false}], "store": {"key": "", "key1": "", "key2": ""}, "allowedHostnames": ["dub.sh"]} "400": application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found."}} "401": @@ -1654,4 +1711,8 @@ examples: "500": application/json: {"error": {"code": "internal_server_error", "message": "The requested resource was not found."}} examplesVersion: 1.0.1 -generatedTests: {} +generatedTests: + createTag: "2025-05-26T17:23:32+05:30" + getTags: "2025-05-26T17:23:32+05:30" + updateTag: "2025-05-26T17:23:32+05:30" + deleteTag: "2025-05-26T17:23:32+05:30" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 60311c6b..d467128f 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -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: diff --git a/.speakeasy/testfiles/example.file b/.speakeasy/testfiles/example.file new file mode 100644 index 00000000..3b18e512 --- /dev/null +++ b/.speakeasy/testfiles/example.file @@ -0,0 +1 @@ +hello world diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml new file mode 100644 index 00000000..087f005c --- /dev/null +++ b/.speakeasy/tests.arazzo.yaml @@ -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: + 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: + 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" diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 54e1784e..b8870d22 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -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: @@ -36,3 +35,5 @@ workflow: output: codeSamples.yaml registry: location: registry.speakeasyapi.dev/dub/dub/code-samples-typescript-my-first-target + testing: + enabled: true diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 409a69e1..8bedfa25 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -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: @@ -17,3 +17,5 @@ targets: output: codeSamples.yaml registry: location: registry.speakeasyapi.dev/dub/dub/code-samples-typescript-my-first-target + testing: + enabled: true diff --git a/README.md b/README.md index 4d2324fa..0a2e3849 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) @@ -634,6 +638,8 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). Available standalone functions - [`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 @@ -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 diff --git a/codeSamples.yaml b/codeSamples.yaml index d01e1886..da638e77 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -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": @@ -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": diff --git a/docs/models/components/analyticstoplinks.md b/docs/models/components/analyticstoplinks.md index ccba4846..3365b719 100644 --- a/docs/models/components/analyticstoplinks.md +++ b/docs/models/components/analyticstoplinks.md @@ -12,7 +12,7 @@ let value: AnalyticsTopLinks = { key: "", shortLink: "", url: "https://limited-onset.com", - createdAt: "1734733846845", + createdAt: "1736502914639", }; ``` diff --git a/docs/models/components/clickevent.md b/docs/models/components/clickevent.md index 12179a39..4c18aaaa 100644 --- a/docs/models/components/clickevent.md +++ b/docs/models/components/clickevent.md @@ -35,7 +35,7 @@ let value: ClickEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1761291730626", + expiresAt: "1763060800414", expiredUrl: "https://awesome-loaf.name", password: "APvsoMbrZcB4BkV", proxy: false, @@ -75,8 +75,8 @@ let value: ClickEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1715940649992", - updatedAt: "1746456377034", + createdAt: "1717709719782", + updatedAt: "1748225446823", projectId: "", }, clickId: "", diff --git a/docs/models/components/customer.md b/docs/models/components/customer.md index 8e91797b..c75e8984 100644 --- a/docs/models/components/customer.md +++ b/docs/models/components/customer.md @@ -9,7 +9,7 @@ let value: Customer = { id: "", externalId: "", name: "", - createdAt: "1741402435729", + createdAt: "1743171502795", }; ``` @@ -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. | \ No newline at end of file diff --git a/docs/models/components/data.md b/docs/models/components/data.md index 0f27ee9d..52dc7674 100644 --- a/docs/models/components/data.md +++ b/docs/models/components/data.md @@ -33,7 +33,7 @@ let value: Data = { programId: "", partnerId: "", archived: false, - expiresAt: "1763653950176", + expiresAt: "1765423017324", expiredUrl: "https://roasted-sarong.net/", password: "mfjOcY3R8z5E_hw", proxy: false, @@ -73,8 +73,8 @@ let value: Data = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1732983407767", - updatedAt: "1746425072535", + createdAt: "1734752474900", + updatedAt: "1748194139669", projectId: "", }, }; diff --git a/docs/models/components/domainschema.md b/docs/models/components/domainschema.md index 85587e2d..a7f0eec0 100644 --- a/docs/models/components/domainschema.md +++ b/docs/models/components/domainschema.md @@ -12,12 +12,12 @@ let value: DomainSchema = { expiredUrl: "https://acme.com/expired", notFoundUrl: "https://acme.com/not-found", logo: "", - createdAt: "1723130577854", - updatedAt: "1746474416400", + createdAt: "1724899641186", + updatedAt: "1748243479732", registeredDomain: { id: "", - createdAt: "1720179502808", - expiresAt: "1758035136897", + createdAt: "1721948566139", + expiresAt: "1759804200228", }, }; ``` diff --git a/docs/models/components/folderschema.md b/docs/models/components/folderschema.md index 3e456452..dc9963b3 100644 --- a/docs/models/components/folderschema.md +++ b/docs/models/components/folderschema.md @@ -9,8 +9,8 @@ let value: FolderSchema = { id: "", name: "", type: "mega", - createdAt: "1735531034317", - updatedAt: "1746454959381", + createdAt: "1737300099097", + updatedAt: "1748224024161", }; ``` diff --git a/docs/models/components/leadcreatedevent.md b/docs/models/components/leadcreatedevent.md index edc8b169..e942d873 100644 --- a/docs/models/components/leadcreatedevent.md +++ b/docs/models/components/leadcreatedevent.md @@ -10,14 +10,14 @@ import { LeadCreatedEvent } from "dub/models/components"; let value: LeadCreatedEvent = { id: "", event: "lead.created", - createdAt: "1721231950042", + createdAt: "1723001017957", data: { eventName: "", customer: { id: "", externalId: "", name: "", - createdAt: "1733853741556", + createdAt: "1735622809469", }, click: { id: "", @@ -46,7 +46,7 @@ let value: LeadCreatedEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1770921583338", + expiresAt: "1772690651243", expiredUrl: "https://elegant-airman.biz", password: "px2bFC6L4ws4Qn8", proxy: false, @@ -86,8 +86,8 @@ let value: LeadCreatedEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1717191530524", - updatedAt: "1746485059624", + createdAt: "1718960598408", + updatedAt: "1748254127508", projectId: "", }, }, diff --git a/docs/models/components/leadcreatedeventcustomer.md b/docs/models/components/leadcreatedeventcustomer.md index d0860a74..63432f34 100644 --- a/docs/models/components/leadcreatedeventcustomer.md +++ b/docs/models/components/leadcreatedeventcustomer.md @@ -9,7 +9,7 @@ let value: LeadCreatedEventCustomer = { id: "", externalId: "", name: "", - createdAt: "1726081762202", + createdAt: "1727850832929", }; ``` @@ -23,4 +23,6 @@ let value: LeadCreatedEventCustomer = { | `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. | \ No newline at end of file diff --git a/docs/models/components/leadcreatedeventdata.md b/docs/models/components/leadcreatedeventdata.md index 9184bcbe..27445322 100644 --- a/docs/models/components/leadcreatedeventdata.md +++ b/docs/models/components/leadcreatedeventdata.md @@ -11,7 +11,7 @@ let value: LeadCreatedEventData = { id: "", externalId: "", name: "", - createdAt: "1746102227542", + createdAt: "1747871295480", }, click: { id: "", @@ -40,7 +40,7 @@ let value: LeadCreatedEventData = { programId: "", partnerId: "", archived: false, - expiresAt: "1750618062683", + expiresAt: "1752387130612", expiredUrl: "https://shady-lift.name/", password: "PHGFNj6Ztrm7Ims", proxy: false, @@ -81,8 +81,8 @@ let value: LeadCreatedEventData = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1731612086855", - updatedAt: "1746481763992", + createdAt: "1733381154775", + updatedAt: "1748250831912", projectId: "", }, }; diff --git a/docs/models/components/leadcreatedeventlink.md b/docs/models/components/leadcreatedeventlink.md index dbe451cc..27be3574 100644 --- a/docs/models/components/leadcreatedeventlink.md +++ b/docs/models/components/leadcreatedeventlink.md @@ -16,7 +16,7 @@ let value: LeadCreatedEventLink = { programId: "", partnerId: "", archived: false, - expiresAt: "1752143939864", + expiresAt: "1753913009367", expiredUrl: "https://funny-chops.org", password: "SBZQsQz5hk89Xw9", proxy: false, @@ -57,8 +57,8 @@ let value: LeadCreatedEventLink = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1720670265654", - updatedAt: "1746467878248", + createdAt: "1722439335118", + updatedAt: "1748236947711", projectId: "", }; ``` diff --git a/docs/models/components/leadevent.md b/docs/models/components/leadevent.md index 841b67f5..c059b54c 100644 --- a/docs/models/components/leadevent.md +++ b/docs/models/components/leadevent.md @@ -37,7 +37,7 @@ let value: LeadEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1757956105971", + expiresAt: "1759725175434", expiredUrl: "https://same-fledgling.net", password: "uxed7Y4vq0I_5hn", proxy: false, @@ -77,15 +77,15 @@ let value: LeadEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1741734677987", - updatedAt: "1746456384036", + createdAt: "1743503747438", + updatedAt: "1748225453487", projectId: "", }, customer: { id: "", externalId: "", name: "", - createdAt: "1738889486161", + createdAt: "1740658555611", }, clickId: "", linkId: "", diff --git a/docs/models/components/leadeventlink.md b/docs/models/components/leadeventlink.md index 779b1dc2..b02f37c8 100644 --- a/docs/models/components/leadeventlink.md +++ b/docs/models/components/leadeventlink.md @@ -16,7 +16,7 @@ let value: LeadEventLink = { programId: "", partnerId: "", archived: false, - expiresAt: "1755350180245", + expiresAt: "1757119247914", expiredUrl: "https://orange-scarification.biz", password: "iOeExVQQi7abjRm", proxy: false, @@ -55,8 +55,8 @@ let value: LeadEventLink = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1733989971789", - updatedAt: "1746470688129", + createdAt: "1735759039443", + updatedAt: "1748239755783", projectId: "", }; ``` diff --git a/docs/models/components/link.md b/docs/models/components/link.md index 45c883a3..c792248d 100644 --- a/docs/models/components/link.md +++ b/docs/models/components/link.md @@ -16,7 +16,7 @@ let value: Link = { programId: "", partnerId: "", archived: false, - expiresAt: "1761904460549", + expiresAt: "1763673526594", expiredUrl: "https://dearest-brief.net/", password: "sF2Rc3WJhIc4meW", proxy: false, @@ -55,8 +55,8 @@ let value: Link = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1732343992322", - updatedAt: "1746414581057", + createdAt: "1734113058336", + updatedAt: "1748183647072", projectId: "", }; ``` diff --git a/docs/models/components/linkclickedevent.md b/docs/models/components/linkclickedevent.md index 1a80aaa5..8bd06487 100644 --- a/docs/models/components/linkclickedevent.md +++ b/docs/models/components/linkclickedevent.md @@ -10,7 +10,7 @@ import { LinkClickedEvent } from "dub/models/components"; let value: LinkClickedEvent = { id: "", event: "link.clicked", - createdAt: "1738160352192", + createdAt: "1739929418030", data: { click: { id: "", @@ -39,7 +39,7 @@ let value: LinkClickedEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1746521066082", + expiresAt: "1748290131912", expiredUrl: "https://same-skean.biz/", password: "3eYqvwIWLmIQoIm", proxy: false, @@ -79,8 +79,8 @@ let value: LinkClickedEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1729670380524", - updatedAt: "1746488680488", + createdAt: "1731439446282", + updatedAt: "1748257746246", projectId: "", }, }, diff --git a/docs/models/components/linkclickedeventlink.md b/docs/models/components/linkclickedeventlink.md index aa30d5b1..3755a137 100644 --- a/docs/models/components/linkclickedeventlink.md +++ b/docs/models/components/linkclickedeventlink.md @@ -16,7 +16,7 @@ let value: LinkClickedEventLink = { programId: "", partnerId: "", archived: false, - expiresAt: "1767691513386", + expiresAt: "1769460578483", expiredUrl: "https://electric-membership.org/", password: "JYX8h3LhxJavUsF", proxy: false, @@ -55,8 +55,8 @@ let value: LinkClickedEventLink = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1743022127135", - updatedAt: "1746465208120", + createdAt: "1744791192259", + updatedAt: "1748234273244", projectId: "", }; ``` diff --git a/docs/models/components/linkschema.md b/docs/models/components/linkschema.md index 20dbee55..7c1e91e5 100644 --- a/docs/models/components/linkschema.md +++ b/docs/models/components/linkschema.md @@ -14,7 +14,7 @@ let value: LinkSchema = { tenantId: "", programId: "", partnerId: "", - expiresAt: "1773002038092", + expiresAt: "1774771103135", expiredUrl: "https://livid-midwife.name/", password: "Y3PMx2MIB7eQGpA", title: "", @@ -48,8 +48,8 @@ let value: LinkSchema = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1728373457220", - updatedAt: "1746419264767", + createdAt: "1730142522248", + updatedAt: "1748188329794", projectId: "", }; ``` diff --git a/docs/models/components/linkwebhookevent.md b/docs/models/components/linkwebhookevent.md index fab102fb..09e151cf 100644 --- a/docs/models/components/linkwebhookevent.md +++ b/docs/models/components/linkwebhookevent.md @@ -10,7 +10,7 @@ import { LinkWebhookEvent } from "dub/models/components"; let value: LinkWebhookEvent = { id: "", event: "link.deleted", - createdAt: "1729245284413", + createdAt: "1731014352818", data: { id: "", domain: "political-birth.name", @@ -22,7 +22,7 @@ let value: LinkWebhookEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1753360390752", + expiresAt: "1755129459157", expiredUrl: "https://deafening-pronoun.info", password: "Rafvfob4pfCF6Nj", proxy: false, @@ -62,8 +62,8 @@ let value: LinkWebhookEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1735414053473", - updatedAt: "1746445367989", + createdAt: "1737183121878", + updatedAt: "1748214436395", projectId: "", }, }; diff --git a/docs/models/components/linkwebhookeventlink.md b/docs/models/components/linkwebhookeventlink.md index 657bff6b..55de9317 100644 --- a/docs/models/components/linkwebhookeventlink.md +++ b/docs/models/components/linkwebhookeventlink.md @@ -16,7 +16,7 @@ let value: LinkWebhookEventLink = { programId: "", partnerId: "", archived: false, - expiresAt: "1770067822313", + expiresAt: "1771836887664", expiredUrl: "https://sorrowful-fireplace.biz", password: "A_N8Ikbav2CAkYs", proxy: false, @@ -55,8 +55,8 @@ let value: LinkWebhookEventLink = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1721287167531", - updatedAt: "1746461056082", + createdAt: "1723056232876", + updatedAt: "1748230121427", projectId: "", }; ``` diff --git a/docs/models/components/partneranalyticstoplinks.md b/docs/models/components/partneranalyticstoplinks.md index dff6d60e..cf925f24 100644 --- a/docs/models/components/partneranalyticstoplinks.md +++ b/docs/models/components/partneranalyticstoplinks.md @@ -12,7 +12,7 @@ let value: PartnerAnalyticsTopLinks = { key: "", shortLink: "", url: "https://milky-exasperation.info/", - createdAt: "1726205056431", + createdAt: "1727974123382", }; ``` diff --git a/docs/models/components/partnerenrolledevent.md b/docs/models/components/partnerenrolledevent.md index c539db1d..7a248695 100644 --- a/docs/models/components/partnerenrolledevent.md +++ b/docs/models/components/partnerenrolledevent.md @@ -10,17 +10,23 @@ import { PartnerEnrolledEvent } from "dub/models/components"; let value: PartnerEnrolledEvent = { id: "", event: "partner.enrolled", - createdAt: "1729510293947", + createdAt: "1731279360612", data: { id: "", name: "", email: "Aditya_Balistreri@hotmail.com", image: "https://picsum.photos/seed/FPQojeSAjJ/1197/310", country: "Tuvalu", + website: "", + youtube: "", + twitter: "", + linkedin: "", + instagram: "", + tiktok: "", paypalEmail: "", stripeConnectId: "", payoutsEnabledAt: "", - createdAt: "1744065575959", + createdAt: "1745834642617", status: "rejected", programId: "", tenantId: "", diff --git a/docs/models/components/partnerenrolledeventdata.md b/docs/models/components/partnerenrolledeventdata.md index 8d77b26f..96654a39 100644 --- a/docs/models/components/partnerenrolledeventdata.md +++ b/docs/models/components/partnerenrolledeventdata.md @@ -11,10 +11,16 @@ let value: PartnerEnrolledEventData = { email: "Luella_Streich@hotmail.com", image: "https://loremflickr.com/2147/1657?lock=6571640826873655", country: "Slovenia", + website: "", + youtube: "", + twitter: "", + linkedin: "", + instagram: "", + tiktok: "", paypalEmail: "", stripeConnectId: "", payoutsEnabledAt: "", - createdAt: "1721487219303", + createdAt: "1723256285740", status: "invited", programId: "", tenantId: "", @@ -32,25 +38,31 @@ let value: PartnerEnrolledEventData = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `email` | *string* | :heavy_check_mark: | N/A | -| `image` | *string* | :heavy_check_mark: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `country` | *string* | :heavy_check_mark: | N/A | -| `paypalEmail` | *string* | :heavy_check_mark: | N/A | -| `stripeConnectId` | *string* | :heavy_check_mark: | N/A | -| `payoutsEnabledAt` | *string* | :heavy_check_mark: | N/A | -| `createdAt` | *string* | :heavy_check_mark: | N/A | -| `status` | [components.Status](../../models/components/status.md) | :heavy_check_mark: | N/A | -| `programId` | *string* | :heavy_check_mark: | N/A | -| `tenantId` | *string* | :heavy_check_mark: | N/A | -| `links` | [components.PartnerEnrolledEventLink](../../models/components/partnerenrolledeventlink.md)[] | :heavy_check_mark: | N/A | -| `clicks` | *number* | :heavy_minus_sign: | N/A | -| `leads` | *number* | :heavy_minus_sign: | N/A | -| `sales` | *number* | :heavy_minus_sign: | N/A | -| `saleAmount` | *number* | :heavy_minus_sign: | N/A | -| `earnings` | *number* | :heavy_minus_sign: | N/A | -| `applicationId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The partner's unique ID on Dub. | +| `name` | *string* | :heavy_check_mark: | The partner's full legal name. | +| `email` | *string* | :heavy_check_mark: | The partner's email address. Should be a unique value across Dub. | +| `image` | *string* | :heavy_check_mark: | The partner's avatar image. | +| `description` | *string* | :heavy_minus_sign: | A brief description of the partner and their background. | +| `country` | *string* | :heavy_check_mark: | The partner's country (required for tax purposes). | +| `website` | *string* | :heavy_check_mark: | The partner's website URL (including the https protocol). | +| `youtube` | *string* | :heavy_check_mark: | The partner's YouTube channel username (e.g. `johndoe`). | +| `twitter` | *string* | :heavy_check_mark: | The partner's Twitter username (e.g. `johndoe`). | +| `linkedin` | *string* | :heavy_check_mark: | The partner's LinkedIn username (e.g. `johndoe`). | +| `instagram` | *string* | :heavy_check_mark: | The partner's Instagram username (e.g. `johndoe`). | +| `tiktok` | *string* | :heavy_check_mark: | The partner's TikTok username (e.g. `johndoe`). | +| `paypalEmail` | *string* | :heavy_check_mark: | The partner's PayPal email (for receiving payouts via PayPal). | +| `stripeConnectId` | *string* | :heavy_check_mark: | The partner's Stripe Connect ID (for receiving payouts via Stripe). | +| `payoutsEnabledAt` | *string* | :heavy_check_mark: | The date when the partner enabled payouts. | +| `createdAt` | *string* | :heavy_check_mark: | The date when the partner was created on Dub. | +| `status` | [components.Status](../../models/components/status.md) | :heavy_check_mark: | The status of the partner's enrollment in the program. | +| `programId` | *string* | :heavy_check_mark: | The program's unique ID on Dub. | +| `tenantId` | *string* | :heavy_check_mark: | The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future. | +| `links` | [components.PartnerEnrolledEventLink](../../models/components/partnerenrolledeventlink.md)[] | :heavy_check_mark: | The partner's referral links in this program. | +| `clicks` | *number* | :heavy_minus_sign: | The total number of clicks on the partner's links. | +| `leads` | *number* | :heavy_minus_sign: | The total number of leads generated by the partner's links. | +| `sales` | *number* | :heavy_minus_sign: | The total number of sales generated by the partner's links. | +| `saleAmount` | *number* | :heavy_minus_sign: | The total amount of sales (in cents) generated by the partner's links. | +| `earnings` | *number* | :heavy_minus_sign: | The total earnings/commissions accrued by the partner's links. | +| `applicationId` | *string* | :heavy_minus_sign: | If the partner submitted an application to join the program, this is the ID of the application. | \ No newline at end of file diff --git a/docs/models/components/registereddomain.md b/docs/models/components/registereddomain.md index ffbee0c8..2ffbf24d 100644 --- a/docs/models/components/registereddomain.md +++ b/docs/models/components/registereddomain.md @@ -9,8 +9,8 @@ import { RegisteredDomain } from "dub/models/components"; let value: RegisteredDomain = { id: "", - createdAt: "1727770549439", - expiresAt: "1755147996053", + createdAt: "1729539618982", + expiresAt: "1756917065595", }; ``` diff --git a/docs/models/components/salecreatedevent.md b/docs/models/components/salecreatedevent.md index 30d3ec47..c874ec40 100644 --- a/docs/models/components/salecreatedevent.md +++ b/docs/models/components/salecreatedevent.md @@ -10,14 +10,14 @@ import { SaleCreatedEvent } from "dub/models/components"; let value: SaleCreatedEvent = { id: "", event: "sale.created", - createdAt: "1745051165831", + createdAt: "1746820236605", data: { eventName: "", customer: { id: "", externalId: "", name: "", - createdAt: "1722983127062", + createdAt: "1724752197835", }, click: { id: "", @@ -46,7 +46,7 @@ let value: SaleCreatedEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1747036988491", + expiresAt: "1748806059256", expiredUrl: "https://hairy-lifestyle.biz", password: "8T1B2qYVgp7KA86", proxy: false, @@ -86,8 +86,8 @@ let value: SaleCreatedEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1721776708976", - updatedAt: "1746477856665", + createdAt: "1723545779734", + updatedAt: "1748246927423", projectId: "", }, sale: { diff --git a/docs/models/components/salecreatedeventcustomer.md b/docs/models/components/salecreatedeventcustomer.md index 14beb78b..e82c0453 100644 --- a/docs/models/components/salecreatedeventcustomer.md +++ b/docs/models/components/salecreatedeventcustomer.md @@ -9,7 +9,7 @@ let value: SaleCreatedEventCustomer = { id: "", externalId: "", name: "", - createdAt: "1719037876864", + createdAt: "1720806945218", }; ``` @@ -23,4 +23,6 @@ let value: SaleCreatedEventCustomer = { | `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. | \ No newline at end of file diff --git a/docs/models/components/salecreatedeventdata.md b/docs/models/components/salecreatedeventdata.md index 48b89c39..9a39ba6c 100644 --- a/docs/models/components/salecreatedeventdata.md +++ b/docs/models/components/salecreatedeventdata.md @@ -11,7 +11,7 @@ let value: SaleCreatedEventData = { id: "", externalId: "", name: "", - createdAt: "1726722157507", + createdAt: "1728491227787", }, click: { id: "", @@ -40,7 +40,7 @@ let value: SaleCreatedEventData = { programId: "", partnerId: "", archived: false, - expiresAt: "1753687153697", + expiresAt: "1755456223970", expiredUrl: "https://rich-trash.com/", password: "TFRZG_gaC6N5rdF", proxy: false, @@ -81,8 +81,8 @@ let value: SaleCreatedEventData = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1722260856800", - updatedAt: "1746432670423", + createdAt: "1724029927056", + updatedAt: "1748201740680", projectId: "", }, sale: { diff --git a/docs/models/components/salecreatedeventlink.md b/docs/models/components/salecreatedeventlink.md index 57b95df6..ed85b2a5 100644 --- a/docs/models/components/salecreatedeventlink.md +++ b/docs/models/components/salecreatedeventlink.md @@ -16,7 +16,7 @@ let value: SaleCreatedEventLink = { programId: "", partnerId: "", archived: false, - expiresAt: "1751098834481", + expiresAt: "1752867901841", expiredUrl: "https://shiny-pomelo.com/", password: "yfAQlanWPXSPKV8", proxy: false, @@ -55,8 +55,8 @@ let value: SaleCreatedEventLink = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1725087566873", - updatedAt: "1746450043824", + createdAt: "1726856634225", + updatedAt: "1748219111176", projectId: "", }; ``` diff --git a/docs/models/components/saleevent.md b/docs/models/components/saleevent.md index 89b2d8b6..11bf4b3d 100644 --- a/docs/models/components/saleevent.md +++ b/docs/models/components/saleevent.md @@ -21,7 +21,7 @@ let value: SaleEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1756081845830", + expiresAt: "1757850914953", expiredUrl: "https://everlasting-kit.info/", password: "Bz5zyB93_ogUDEs", proxy: false, @@ -62,8 +62,8 @@ let value: SaleEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1737601132095", - updatedAt: "1746412661485", + createdAt: "1739370201200", + updatedAt: "1748181730590", projectId: "", }, click: { @@ -86,7 +86,7 @@ let value: SaleEvent = { id: "", externalId: "", name: "", - createdAt: "1730660745264", + createdAt: "1732429814359", }, sale: { amount: 519436, diff --git a/docs/models/components/saleeventcustomer.md b/docs/models/components/saleeventcustomer.md index 41f530ad..a639d3ca 100644 --- a/docs/models/components/saleeventcustomer.md +++ b/docs/models/components/saleeventcustomer.md @@ -9,7 +9,7 @@ let value: SaleEventCustomer = { id: "", externalId: "", name: "", - createdAt: "1731254352062", + createdAt: "1733023420852", }; ``` @@ -23,4 +23,6 @@ let value: SaleEventCustomer = { | `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. | \ No newline at end of file diff --git a/docs/models/components/saleeventlink.md b/docs/models/components/saleeventlink.md index 9ebb0b78..c8fb3def 100644 --- a/docs/models/components/saleeventlink.md +++ b/docs/models/components/saleeventlink.md @@ -16,7 +16,7 @@ let value: SaleEventLink = { programId: "", partnerId: "", archived: false, - expiresAt: "1774326737981", + expiresAt: "1776095808131", expiredUrl: "https://optimal-flame.net/", password: "DHaXlMpWy07Hks0", proxy: false, @@ -56,8 +56,8 @@ let value: SaleEventLink = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1719849093529", - updatedAt: "1746457705927", + createdAt: "1721618163657", + updatedAt: "1748226776055", projectId: "", }; ``` diff --git a/docs/models/components/status.md b/docs/models/components/status.md index e2038d7e..335814af 100644 --- a/docs/models/components/status.md +++ b/docs/models/components/status.md @@ -1,5 +1,7 @@ # Status +The status of the partner's enrollment in the program. + ## Example Usage ```typescript diff --git a/docs/models/components/webhookevent.md b/docs/models/components/webhookevent.md index 0d7dc87b..a26e359d 100644 --- a/docs/models/components/webhookevent.md +++ b/docs/models/components/webhookevent.md @@ -11,7 +11,7 @@ Webhook event schema const value: components.LinkWebhookEvent = { id: "", event: "link.deleted", - createdAt: "1734009811965", + createdAt: "1735778881227", data: { id: "", domain: "exalted-pinstripe.com", @@ -23,7 +23,7 @@ const value: components.LinkWebhookEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1765854827297", + expiresAt: "1767623896558", expiredUrl: "https://illustrious-jungle.org/", password: "DwH3aXJCJcSX4Ff", proxy: false, @@ -62,8 +62,8 @@ const value: components.LinkWebhookEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1725048083787", - updatedAt: "1746421724378", + createdAt: "1726817153018", + updatedAt: "1748190793609", projectId: "", }, }; @@ -75,7 +75,7 @@ const value: components.LinkWebhookEvent = { const value: components.LinkClickedEvent = { id: "", event: "link.clicked", - createdAt: "1743583767342", + createdAt: "1745352836504", data: { click: { id: "", @@ -104,7 +104,7 @@ const value: components.LinkClickedEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1760966984165", + expiresAt: "1762736053306", expiredUrl: "https://delectable-quart.com", password: "yG3N11IQ7NfAdxc", proxy: false, @@ -144,8 +144,8 @@ const value: components.LinkClickedEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1735884430129", - updatedAt: "1746409745060", + createdAt: "1737653499250", + updatedAt: "1748178814180", projectId: "", }, }, @@ -158,14 +158,14 @@ const value: components.LinkClickedEvent = { const value: components.LeadCreatedEvent = { id: "", event: "lead.created", - createdAt: "1742468419829", + createdAt: "1744237488950", data: { eventName: "", customer: { id: "", externalId: "", name: "", - createdAt: "1728960519344", + createdAt: "1730729588464", }, click: { id: "", @@ -194,7 +194,7 @@ const value: components.LeadCreatedEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1772997983013", + expiresAt: "1774767052130", expiredUrl: "https://hoarse-help.name", password: "gsfx4xnq8zKCIO6", proxy: false, @@ -235,8 +235,8 @@ const value: components.LeadCreatedEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1734420562331", - updatedAt: "1746432792810", + createdAt: "1736189631437", + updatedAt: "1748201861916", projectId: "", }, }, @@ -249,14 +249,14 @@ const value: components.LeadCreatedEvent = { const value: components.SaleCreatedEvent = { id: "", event: "sale.created", - createdAt: "1715219294987", + createdAt: "1716988364092", data: { eventName: "", customer: { id: "", externalId: "", name: "", - createdAt: "1742927021046", + createdAt: "1744696090150", }, click: { id: "", @@ -285,7 +285,7 @@ const value: components.SaleCreatedEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1747630894562", + expiresAt: "1749399963657", expiredUrl: "https://obedient-strategy.name/", password: "eXOXZ2USj7cH2Nh", proxy: false, @@ -325,8 +325,8 @@ const value: components.SaleCreatedEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1725738973693", - updatedAt: "1746477518415", + createdAt: "1727508042776", + updatedAt: "1748246587498", projectId: "", }, sale: { @@ -345,17 +345,23 @@ const value: components.SaleCreatedEvent = { const value: components.PartnerEnrolledEvent = { id: "", event: "partner.enrolled", - createdAt: "1721498443248", + createdAt: "1723267512323", data: { id: "", name: "", email: "Reed_Jacobs@yahoo.com", image: "https://loremflickr.com/1614/897?lock=3218436465907020", country: "Maldives", + website: "", + youtube: "", + twitter: "", + linkedin: "", + instagram: "", + tiktok: "", paypalEmail: "", stripeConnectId: "", payoutsEnabledAt: "", - createdAt: "1726280097632", + createdAt: "1728049166705", status: "rejected", programId: "", tenantId: "", diff --git a/docs/models/components/workspaceschema.md b/docs/models/components/workspaceschema.md index 4b474448..e6973bee 100644 --- a/docs/models/components/workspaceschema.md +++ b/docs/models/components/workspaceschema.md @@ -32,7 +32,7 @@ let value: WorkspaceSchema = { conversionEnabled: false, dotLinkClaimed: false, partnersEnabled: false, - createdAt: "1730303757736", + createdAt: "1732072825917", users: [ { role: "owner", diff --git a/docs/models/operations/createcustomerlink.md b/docs/models/operations/createcustomerlink.md index e31b4cc7..cce33ba7 100644 --- a/docs/models/operations/createcustomerlink.md +++ b/docs/models/operations/createcustomerlink.md @@ -10,6 +10,7 @@ let value: CreateCustomerLink = { domain: "bowed-cassava.name", key: "", shortLink: "https://splendid-masterpiece.com", + url: "https://regal-grandson.com/", programId: "", }; ``` @@ -22,4 +23,5 @@ let value: CreateCustomerLink = { | `domain` | *string* | :heavy_check_mark: | The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). | | `key` | *string* | :heavy_check_mark: | The short link slug. If not provided, a random 7-character slug will be generated. | | `shortLink` | *string* | :heavy_check_mark: | The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). | +| `url` | *string* | :heavy_check_mark: | The destination URL of the short link. | | `programId` | *string* | :heavy_check_mark: | The ID of the program the short link is associated with. | \ No newline at end of file diff --git a/docs/models/operations/createcustomerpartner.md b/docs/models/operations/createcustomerpartner.md index 9e836908..be2e30eb 100644 --- a/docs/models/operations/createcustomerpartner.md +++ b/docs/models/operations/createcustomerpartner.md @@ -15,9 +15,9 @@ let value: CreateCustomerPartner = { ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `email` | *string* | :heavy_check_mark: | N/A | -| `image` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The partner's unique ID on Dub. | +| `name` | *string* | :heavy_check_mark: | The partner's full legal name. | +| `email` | *string* | :heavy_check_mark: | The partner's email address. Should be a unique value across Dub. | +| `image` | *string* | :heavy_check_mark: | The partner's avatar image. | \ No newline at end of file diff --git a/docs/models/operations/createcustomerresponsebody.md b/docs/models/operations/createcustomerresponsebody.md index fee3ed92..b329375f 100644 --- a/docs/models/operations/createcustomerresponsebody.md +++ b/docs/models/operations/createcustomerresponsebody.md @@ -11,7 +11,7 @@ let value: CreateCustomerResponseBody = { id: "", externalId: "", name: "", - createdAt: "1723521056947", + createdAt: "1725290123415", }; ``` @@ -25,6 +25,8 @@ let value: CreateCustomerResponseBody = { | `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. | | `link` | [operations.CreateCustomerLink](../../models/operations/createcustomerlink.md) | :heavy_minus_sign: | N/A | | `programId` | *string* | :heavy_minus_sign: | N/A | diff --git a/docs/models/operations/createpartnerresponsebody.md b/docs/models/operations/createpartnerresponsebody.md index a67a7a25..4d43c9c1 100644 --- a/docs/models/operations/createpartnerresponsebody.md +++ b/docs/models/operations/createpartnerresponsebody.md @@ -13,10 +13,16 @@ let value: CreatePartnerResponseBody = { email: "Ellie59@hotmail.com", image: "https://picsum.photos/seed/dMa8Wlupt4/2565/2570", country: "Cote d'Ivoire", + website: "", + youtube: "", + twitter: "", + linkedin: "", + instagram: "", + tiktok: "", paypalEmail: "", stripeConnectId: "", payoutsEnabledAt: "", - createdAt: "1717747472074", + createdAt: "1719516536044", status: "invited", programId: "", tenantId: "", @@ -34,25 +40,31 @@ let value: CreatePartnerResponseBody = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `email` | *string* | :heavy_check_mark: | N/A | -| `image` | *string* | :heavy_check_mark: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `country` | *string* | :heavy_check_mark: | N/A | -| `paypalEmail` | *string* | :heavy_check_mark: | N/A | -| `stripeConnectId` | *string* | :heavy_check_mark: | N/A | -| `payoutsEnabledAt` | *string* | :heavy_check_mark: | N/A | -| `createdAt` | *string* | :heavy_check_mark: | N/A | -| `status` | [operations.Status](../../models/operations/status.md) | :heavy_check_mark: | N/A | -| `programId` | *string* | :heavy_check_mark: | N/A | -| `tenantId` | *string* | :heavy_check_mark: | N/A | -| `links` | [operations.CreatePartnerLink](../../models/operations/createpartnerlink.md)[] | :heavy_check_mark: | N/A | -| `clicks` | *number* | :heavy_minus_sign: | N/A | -| `leads` | *number* | :heavy_minus_sign: | N/A | -| `sales` | *number* | :heavy_minus_sign: | N/A | -| `saleAmount` | *number* | :heavy_minus_sign: | N/A | -| `earnings` | *number* | :heavy_minus_sign: | N/A | -| `applicationId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The partner's unique ID on Dub. | +| `name` | *string* | :heavy_check_mark: | The partner's full legal name. | +| `email` | *string* | :heavy_check_mark: | The partner's email address. Should be a unique value across Dub. | +| `image` | *string* | :heavy_check_mark: | The partner's avatar image. | +| `description` | *string* | :heavy_minus_sign: | A brief description of the partner and their background. | +| `country` | *string* | :heavy_check_mark: | The partner's country (required for tax purposes). | +| `website` | *string* | :heavy_check_mark: | The partner's website URL (including the https protocol). | +| `youtube` | *string* | :heavy_check_mark: | The partner's YouTube channel username (e.g. `johndoe`). | +| `twitter` | *string* | :heavy_check_mark: | The partner's Twitter username (e.g. `johndoe`). | +| `linkedin` | *string* | :heavy_check_mark: | The partner's LinkedIn username (e.g. `johndoe`). | +| `instagram` | *string* | :heavy_check_mark: | The partner's Instagram username (e.g. `johndoe`). | +| `tiktok` | *string* | :heavy_check_mark: | The partner's TikTok username (e.g. `johndoe`). | +| `paypalEmail` | *string* | :heavy_check_mark: | The partner's PayPal email (for receiving payouts via PayPal). | +| `stripeConnectId` | *string* | :heavy_check_mark: | The partner's Stripe Connect ID (for receiving payouts via Stripe). | +| `payoutsEnabledAt` | *string* | :heavy_check_mark: | The date when the partner enabled payouts. | +| `createdAt` | *string* | :heavy_check_mark: | The date when the partner was created on Dub. | +| `status` | [operations.CreatePartnerStatus](../../models/operations/createpartnerstatus.md) | :heavy_check_mark: | The status of the partner's enrollment in the program. | +| `programId` | *string* | :heavy_check_mark: | The program's unique ID on Dub. | +| `tenantId` | *string* | :heavy_check_mark: | The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future. | +| `links` | [operations.CreatePartnerLink](../../models/operations/createpartnerlink.md)[] | :heavy_check_mark: | The partner's referral links in this program. | +| `clicks` | *number* | :heavy_minus_sign: | The total number of clicks on the partner's links. | +| `leads` | *number* | :heavy_minus_sign: | The total number of leads generated by the partner's links. | +| `sales` | *number* | :heavy_minus_sign: | The total number of sales generated by the partner's links. | +| `saleAmount` | *number* | :heavy_minus_sign: | The total amount of sales (in cents) generated by the partner's links. | +| `earnings` | *number* | :heavy_minus_sign: | The total earnings/commissions accrued by the partner's links. | +| `applicationId` | *string* | :heavy_minus_sign: | If the partner submitted an application to join the program, this is the ID of the application. | \ No newline at end of file diff --git a/docs/models/operations/createpartnerstatus.md b/docs/models/operations/createpartnerstatus.md new file mode 100644 index 00000000..76731dcc --- /dev/null +++ b/docs/models/operations/createpartnerstatus.md @@ -0,0 +1,17 @@ +# CreatePartnerStatus + +The status of the partner's enrollment in the program. + +## Example Usage + +```typescript +import { CreatePartnerStatus } from "dub/models/operations"; + +let value: CreatePartnerStatus = "declined"; +``` + +## Values + +```typescript +"pending" | "approved" | "rejected" | "invited" | "declined" | "banned" +``` \ No newline at end of file diff --git a/docs/models/operations/getcustomerlink.md b/docs/models/operations/getcustomerlink.md index 40669d22..b14163d5 100644 --- a/docs/models/operations/getcustomerlink.md +++ b/docs/models/operations/getcustomerlink.md @@ -10,6 +10,7 @@ let value: GetCustomerLink = { domain: "gracious-draft.net", key: "", shortLink: "https://speedy-cd.name", + url: "https://sugary-programme.info/", programId: "", }; ``` @@ -22,4 +23,5 @@ let value: GetCustomerLink = { | `domain` | *string* | :heavy_check_mark: | The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). | | `key` | *string* | :heavy_check_mark: | The short link slug. If not provided, a random 7-character slug will be generated. | | `shortLink` | *string* | :heavy_check_mark: | The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). | +| `url` | *string* | :heavy_check_mark: | The destination URL of the short link. | | `programId` | *string* | :heavy_check_mark: | The ID of the program the short link is associated with. | \ No newline at end of file diff --git a/docs/models/operations/getcustomerpartner.md b/docs/models/operations/getcustomerpartner.md index 0a458493..f4a832d6 100644 --- a/docs/models/operations/getcustomerpartner.md +++ b/docs/models/operations/getcustomerpartner.md @@ -15,9 +15,9 @@ let value: GetCustomerPartner = { ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `email` | *string* | :heavy_check_mark: | N/A | -| `image` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The partner's unique ID on Dub. | +| `name` | *string* | :heavy_check_mark: | The partner's full legal name. | +| `email` | *string* | :heavy_check_mark: | The partner's email address. Should be a unique value across Dub. | +| `image` | *string* | :heavy_check_mark: | The partner's avatar image. | \ No newline at end of file diff --git a/docs/models/operations/getcustomerresponsebody.md b/docs/models/operations/getcustomerresponsebody.md index 218e7c02..178f5d8a 100644 --- a/docs/models/operations/getcustomerresponsebody.md +++ b/docs/models/operations/getcustomerresponsebody.md @@ -11,7 +11,7 @@ let value: GetCustomerResponseBody = { id: "", externalId: "", name: "", - createdAt: "1732673493779", + createdAt: "1734442557915", }; ``` @@ -25,6 +25,8 @@ let value: GetCustomerResponseBody = { | `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. | | `link` | [operations.GetCustomerLink](../../models/operations/getcustomerlink.md) | :heavy_minus_sign: | N/A | | `programId` | *string* | :heavy_minus_sign: | N/A | diff --git a/docs/models/operations/getcustomerslink.md b/docs/models/operations/getcustomerslink.md index 8ceee323..0c739e93 100644 --- a/docs/models/operations/getcustomerslink.md +++ b/docs/models/operations/getcustomerslink.md @@ -10,6 +10,7 @@ let value: GetCustomersLink = { domain: "utter-bid.info", key: "", shortLink: "https://good-suspension.org/", + url: "https://blushing-cricket.com", programId: "", }; ``` @@ -22,4 +23,5 @@ let value: GetCustomersLink = { | `domain` | *string* | :heavy_check_mark: | The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). | | `key` | *string* | :heavy_check_mark: | The short link slug. If not provided, a random 7-character slug will be generated. | | `shortLink` | *string* | :heavy_check_mark: | The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). | +| `url` | *string* | :heavy_check_mark: | The destination URL of the short link. | | `programId` | *string* | :heavy_check_mark: | The ID of the program the short link is associated with. | \ No newline at end of file diff --git a/docs/models/operations/getcustomerspartner.md b/docs/models/operations/getcustomerspartner.md index d8665266..4a73f20b 100644 --- a/docs/models/operations/getcustomerspartner.md +++ b/docs/models/operations/getcustomerspartner.md @@ -15,9 +15,9 @@ let value: GetCustomersPartner = { ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `email` | *string* | :heavy_check_mark: | N/A | -| `image` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The partner's unique ID on Dub. | +| `name` | *string* | :heavy_check_mark: | The partner's full legal name. | +| `email` | *string* | :heavy_check_mark: | The partner's email address. Should be a unique value across Dub. | +| `image` | *string* | :heavy_check_mark: | The partner's avatar image. | \ No newline at end of file diff --git a/docs/models/operations/getcustomersqueryparamsortby.md b/docs/models/operations/getcustomersqueryparamsortby.md new file mode 100644 index 00000000..6735e349 --- /dev/null +++ b/docs/models/operations/getcustomersqueryparamsortby.md @@ -0,0 +1,17 @@ +# GetCustomersQueryParamSortBy + +The field to sort the customers by. The default is `createdAt`. + +## Example Usage + +```typescript +import { GetCustomersQueryParamSortBy } from "dub/models/operations"; + +let value: GetCustomersQueryParamSortBy = "saleAmount"; +``` + +## Values + +```typescript +"createdAt" | "saleAmount" +``` \ No newline at end of file diff --git a/docs/models/operations/getcustomersqueryparamsortorder.md b/docs/models/operations/getcustomersqueryparamsortorder.md new file mode 100644 index 00000000..1da4a9eb --- /dev/null +++ b/docs/models/operations/getcustomersqueryparamsortorder.md @@ -0,0 +1,17 @@ +# GetCustomersQueryParamSortOrder + +The sort order. The default is `desc`. + +## Example Usage + +```typescript +import { GetCustomersQueryParamSortOrder } from "dub/models/operations"; + +let value: GetCustomersQueryParamSortOrder = "desc"; +``` + +## Values + +```typescript +"asc" | "desc" +``` \ No newline at end of file diff --git a/docs/models/operations/getcustomersrequest.md b/docs/models/operations/getcustomersrequest.md index 39c47a0a..3c35794c 100644 --- a/docs/models/operations/getcustomersrequest.md +++ b/docs/models/operations/getcustomersrequest.md @@ -15,6 +15,10 @@ let value: GetCustomersRequest = {}; | `email` | *string* | :heavy_minus_sign: | A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. Takes precedence over `externalId`. | | | `externalId` | *string* | :heavy_minus_sign: | A case-sensitive filter on the list based on the customer's `externalId` field. The value must be a string. Takes precedence over `search`. | | | `search` | *string* | :heavy_minus_sign: | A search query to filter customers by email, externalId, or name. If `email` or `externalId` is provided, this will be ignored. | | +| `country` | *string* | :heavy_minus_sign: | A filter on the list based on the customer's `country` field. | | +| `linkId` | *string* | :heavy_minus_sign: | A filter on the list based on the customer's `linkId` field (the referral link ID). | | | `includeExpandedFields` | *boolean* | :heavy_minus_sign: | Whether to include expanded fields on the customer (`link`, `partner`, `discount`). | | +| `sortBy` | [operations.GetCustomersQueryParamSortBy](../../models/operations/getcustomersqueryparamsortby.md) | :heavy_minus_sign: | The field to sort the customers by. The default is `createdAt`. | | +| `sortOrder` | [operations.GetCustomersQueryParamSortOrder](../../models/operations/getcustomersqueryparamsortorder.md) | :heavy_minus_sign: | The sort order. The default is `desc`. | | | `page` | *number* | :heavy_minus_sign: | The page number for pagination. | 1 | | `pageSize` | *number* | :heavy_minus_sign: | The number of items per page. | 50 | \ No newline at end of file diff --git a/docs/models/operations/getcustomersresponsebody.md b/docs/models/operations/getcustomersresponsebody.md index a097a663..08241a55 100644 --- a/docs/models/operations/getcustomersresponsebody.md +++ b/docs/models/operations/getcustomersresponsebody.md @@ -9,7 +9,7 @@ let value: GetCustomersResponseBody = { id: "", externalId: "", name: "", - createdAt: "1723109979348", + createdAt: "1724879049784", }; ``` @@ -23,6 +23,8 @@ let value: GetCustomersResponseBody = { | `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. | | `link` | [operations.GetCustomersLink](../../models/operations/getcustomerslink.md) | :heavy_minus_sign: | N/A | | `programId` | *string* | :heavy_minus_sign: | N/A | diff --git a/docs/models/operations/getlinksresponse.md b/docs/models/operations/getlinksresponse.md index 58420506..ddb354fb 100644 --- a/docs/models/operations/getlinksresponse.md +++ b/docs/models/operations/getlinksresponse.md @@ -16,7 +16,7 @@ let value: GetLinksResponse = { tenantId: "", programId: "", partnerId: "", - expiresAt: "1776809900065", + expiresAt: "1778578967043", expiredUrl: "https://joyful-fowl.org/", password: "A1AZS4x3PgdVHrv", title: "", @@ -50,8 +50,8 @@ let value: GetLinksResponse = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1721464178109", - updatedAt: "1746436868325", + createdAt: "1723233245073", + updatedAt: "1748205935289", projectId: "", }, ], diff --git a/docs/models/operations/listcommissionsqueryparaminterval.md b/docs/models/operations/listcommissionsqueryparaminterval.md new file mode 100644 index 00000000..c49e9446 --- /dev/null +++ b/docs/models/operations/listcommissionsqueryparaminterval.md @@ -0,0 +1,17 @@ +# ListCommissionsQueryParamInterval + +The interval to retrieve commissions for. + +## Example Usage + +```typescript +import { ListCommissionsQueryParamInterval } from "dub/models/operations"; + +let value: ListCommissionsQueryParamInterval = "30d"; +``` + +## Values + +```typescript +"24h" | "7d" | "30d" | "90d" | "1y" | "mtd" | "qtd" | "ytd" | "all" +``` \ No newline at end of file diff --git a/docs/models/operations/listcommissionsqueryparamsortby.md b/docs/models/operations/listcommissionsqueryparamsortby.md new file mode 100644 index 00000000..b8f2b95b --- /dev/null +++ b/docs/models/operations/listcommissionsqueryparamsortby.md @@ -0,0 +1,17 @@ +# ListCommissionsQueryParamSortBy + +The field to sort the list of commissions by. + +## Example Usage + +```typescript +import { ListCommissionsQueryParamSortBy } from "dub/models/operations"; + +let value: ListCommissionsQueryParamSortBy = "amount"; +``` + +## Values + +```typescript +"createdAt" | "amount" +``` \ No newline at end of file diff --git a/docs/models/operations/listcommissionsqueryparamsortorder.md b/docs/models/operations/listcommissionsqueryparamsortorder.md new file mode 100644 index 00000000..f84fe996 --- /dev/null +++ b/docs/models/operations/listcommissionsqueryparamsortorder.md @@ -0,0 +1,17 @@ +# ListCommissionsQueryParamSortOrder + +The sort order for the list of commissions. + +## Example Usage + +```typescript +import { ListCommissionsQueryParamSortOrder } from "dub/models/operations"; + +let value: ListCommissionsQueryParamSortOrder = "asc"; +``` + +## Values + +```typescript +"asc" | "desc" +``` \ No newline at end of file diff --git a/docs/models/operations/listcommissionsrequest.md b/docs/models/operations/listcommissionsrequest.md new file mode 100644 index 00000000..cd67017b --- /dev/null +++ b/docs/models/operations/listcommissionsrequest.md @@ -0,0 +1,27 @@ +# ListCommissionsRequest + +## Example Usage + +```typescript +import { ListCommissionsRequest } from "dub/models/operations"; + +let value: ListCommissionsRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [operations.Type](../../models/operations/type.md) | :heavy_minus_sign: | N/A | | +| `customerId` | *string* | :heavy_minus_sign: | Filter the list of commissions by the associated customer. | | +| `payoutId` | *string* | :heavy_minus_sign: | Filter the list of commissions by the associated payout. | | +| `partnerId` | *string* | :heavy_minus_sign: | Filter the list of commissions by the associated partner. | | +| `invoiceId` | *string* | :heavy_minus_sign: | Filter the list of commissions by the associated invoice. Since invoiceId is unique on a per-program basis, this will only return one commission per invoice. | | +| `status` | [operations.QueryParamStatus](../../models/operations/queryparamstatus.md) | :heavy_minus_sign: | Filter the list of commissions by their corresponding status. | | +| `sortBy` | [operations.ListCommissionsQueryParamSortBy](../../models/operations/listcommissionsqueryparamsortby.md) | :heavy_minus_sign: | The field to sort the list of commissions by. | | +| `sortOrder` | [operations.ListCommissionsQueryParamSortOrder](../../models/operations/listcommissionsqueryparamsortorder.md) | :heavy_minus_sign: | The sort order for the list of commissions. | | +| `interval` | [operations.ListCommissionsQueryParamInterval](../../models/operations/listcommissionsqueryparaminterval.md) | :heavy_minus_sign: | The interval to retrieve commissions for. | | +| `start` | *string* | :heavy_minus_sign: | The start date of the date range to filter the commissions by. | | +| `end` | *string* | :heavy_minus_sign: | The end date of the date range to filter the commissions by. | | +| `page` | *number* | :heavy_minus_sign: | The page number for pagination. | 1 | +| `pageSize` | *number* | :heavy_minus_sign: | The number of items per page. | 50 | \ No newline at end of file diff --git a/docs/models/operations/listcommissionsresponsebody.md b/docs/models/operations/listcommissionsresponsebody.md new file mode 100644 index 00000000..f823f48c --- /dev/null +++ b/docs/models/operations/listcommissionsresponsebody.md @@ -0,0 +1,31 @@ +# ListCommissionsResponseBody + +## Example Usage + +```typescript +import { ListCommissionsResponseBody } from "dub/models/operations"; + +let value: ListCommissionsResponseBody = { + id: "cm_1JVR7XRCSR0EDBAF39FZ4PMYE", + amount: 7467.2, + earnings: 5050.12, + currency: "Australian Dollar", + status: "duplicate", + createdAt: "1723152648591", + updatedAt: "1748210063887", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The commission's unique ID on Dub. | cm_1JVR7XRCSR0EDBAF39FZ4PMYE | +| `type` | [operations.ListCommissionsType](../../models/operations/listcommissionstype.md) | :heavy_minus_sign: | N/A | | +| `amount` | *number* | :heavy_check_mark: | N/A | | +| `earnings` | *number* | :heavy_check_mark: | N/A | | +| `currency` | *string* | :heavy_check_mark: | N/A | | +| `status` | [operations.ListCommissionsStatus](../../models/operations/listcommissionsstatus.md) | :heavy_check_mark: | N/A | | +| `invoiceId` | *string* | :heavy_minus_sign: | N/A | | +| `createdAt` | *string* | :heavy_check_mark: | N/A | | +| `updatedAt` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/updatepartnersalestatus.md b/docs/models/operations/listcommissionsstatus.md similarity index 52% rename from docs/models/operations/updatepartnersalestatus.md rename to docs/models/operations/listcommissionsstatus.md index f15071d2..716b3af4 100644 --- a/docs/models/operations/updatepartnersalestatus.md +++ b/docs/models/operations/listcommissionsstatus.md @@ -1,11 +1,11 @@ -# UpdatePartnerSaleStatus +# ListCommissionsStatus ## Example Usage ```typescript -import { UpdatePartnerSaleStatus } from "dub/models/operations"; +import { ListCommissionsStatus } from "dub/models/operations"; -let value: UpdatePartnerSaleStatus = "paid"; +let value: ListCommissionsStatus = "paid"; ``` ## Values diff --git a/docs/models/operations/listcommissionstype.md b/docs/models/operations/listcommissionstype.md new file mode 100644 index 00000000..22a2d834 --- /dev/null +++ b/docs/models/operations/listcommissionstype.md @@ -0,0 +1,15 @@ +# ListCommissionsType + +## Example Usage + +```typescript +import { ListCommissionsType } from "dub/models/operations"; + +let value: ListCommissionsType = "lead"; +``` + +## Values + +```typescript +"click" | "lead" | "sale" +``` \ No newline at end of file diff --git a/docs/models/operations/listdomainsresponse.md b/docs/models/operations/listdomainsresponse.md index f3e111ca..5c4511b7 100644 --- a/docs/models/operations/listdomainsresponse.md +++ b/docs/models/operations/listdomainsresponse.md @@ -14,12 +14,12 @@ let value: ListDomainsResponse = { expiredUrl: "https://acme.com/expired", notFoundUrl: "https://acme.com/not-found", logo: "", - createdAt: "1715113811715", - updatedAt: "1746436213732", + createdAt: "1716882883017", + updatedAt: "1748205285034", registeredDomain: { id: "", - createdAt: "1735653554863", - expiresAt: "1762673018206", + createdAt: "1737422626165", + expiresAt: "1764442089508", }, }, ], diff --git a/docs/models/operations/listeventsresponsebody.md b/docs/models/operations/listeventsresponsebody.md index e1f83234..635ef066 100644 --- a/docs/models/operations/listeventsresponsebody.md +++ b/docs/models/operations/listeventsresponsebody.md @@ -36,7 +36,7 @@ const value: components.ClickEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1762533729744", + expiresAt: "1764302801217", expiredUrl: "https://pure-sailor.info/", password: "cA3r691SF3WAqsg", proxy: false, @@ -75,8 +75,8 @@ const value: components.ClickEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1721416293461", - updatedAt: "1746441129806", + createdAt: "1723185364900", + updatedAt: "1748210201246", projectId: "", }, clickId: "", @@ -130,7 +130,7 @@ const value: components.LeadEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1759595860921", + expiresAt: "1761364932275", expiredUrl: "https://pushy-mythology.org/", password: "Fm97fzzp1vMGZay", proxy: false, @@ -169,15 +169,15 @@ const value: components.LeadEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1724366064522", - updatedAt: "1746437127419", + createdAt: "1726135135848", + updatedAt: "1748206198745", projectId: "", }, customer: { id: "", externalId: "", name: "", - createdAt: "1743179848454", + createdAt: "1744948919779", }, clickId: "", linkId: "", @@ -214,7 +214,7 @@ const value: components.SaleEvent = { programId: "", partnerId: "", archived: false, - expiresAt: "1763990090234", + expiresAt: "1765759161539", expiredUrl: "https://pitiful-councilman.net/", password: "ndTaCgwQCitLwpa", proxy: false, @@ -254,8 +254,8 @@ const value: components.SaleEvent = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1744347211972", - updatedAt: "1746428620247", + createdAt: "1746116283254", + updatedAt: "1748197691529", projectId: "", }, click: { @@ -278,7 +278,7 @@ const value: components.SaleEvent = { id: "", externalId: "", name: "", - createdAt: "1720735811472", + createdAt: "1722504882745", }, sale: { amount: 783789, diff --git a/docs/models/operations/queryparamstatus.md b/docs/models/operations/queryparamstatus.md new file mode 100644 index 00000000..be9316b4 --- /dev/null +++ b/docs/models/operations/queryparamstatus.md @@ -0,0 +1,17 @@ +# QueryParamStatus + +Filter the list of commissions by their corresponding status. + +## Example Usage + +```typescript +import { QueryParamStatus } from "dub/models/operations"; + +let value: QueryParamStatus = "paid"; +``` + +## Values + +```typescript +"pending" | "processed" | "paid" | "refunded" | "duplicate" | "fraud" | "canceled" +``` \ No newline at end of file diff --git a/docs/models/operations/responsebody.md b/docs/models/operations/responsebody.md index c0c0a91e..67b05525 100644 --- a/docs/models/operations/responsebody.md +++ b/docs/models/operations/responsebody.md @@ -15,7 +15,7 @@ const value: components.LinkSchema = { tenantId: "", programId: "", partnerId: "", - expiresAt: "1765697595872", + expiresAt: "1767466665500", expiredUrl: "https://hairy-printer.org/", password: "atR49jLBfFjqWxm", title: "", @@ -49,8 +49,8 @@ const value: components.LinkSchema = { userId: "", workspaceId: "", lastClicked: "", - createdAt: "1729607977483", - updatedAt: "1746484809650", + createdAt: "1731377047090", + updatedAt: "1748253879256", projectId: "", }; ``` diff --git a/docs/models/operations/retrieveanalyticsresponsebody.md b/docs/models/operations/retrieveanalyticsresponsebody.md index cfad5f62..1e2cf4f9 100644 --- a/docs/models/operations/retrieveanalyticsresponsebody.md +++ b/docs/models/operations/retrieveanalyticsresponsebody.md @@ -135,7 +135,7 @@ const value: components.AnalyticsTopLinks[] = [ key: "", shortLink: "", url: "https://gripping-bog.biz/", - createdAt: "1746371897844", + createdAt: "1748140968561", }, ]; ``` diff --git a/docs/models/operations/retrievepartneranalyticsresponsebody.md b/docs/models/operations/retrievepartneranalyticsresponsebody.md index 2c746e57..139fb1c8 100644 --- a/docs/models/operations/retrievepartneranalyticsresponsebody.md +++ b/docs/models/operations/retrievepartneranalyticsresponsebody.md @@ -32,7 +32,7 @@ const value: components.PartnerAnalyticsTopLinks[] = [ key: "", shortLink: "", url: "https://serpentine-recommendation.org/", - createdAt: "1727281754160", + createdAt: "1729050822139", }, ]; ``` diff --git a/docs/models/operations/status.md b/docs/models/operations/status.md index 51f60d4d..8f706b8e 100644 --- a/docs/models/operations/status.md +++ b/docs/models/operations/status.md @@ -1,15 +1,17 @@ # Status +Useful for marking a commission as refunded, duplicate, canceled, or fraudulent. Takes precedence over `amount` and `modifyAmount`. When a commission is marked as refunded, duplicate, canceled, or fraudulent, it will be omitted from the payout, and the payout amount will be recalculated accordingly. Paid commissions cannot be updated. + ## Example Usage ```typescript import { Status } from "dub/models/operations"; -let value: Status = "invited"; +let value: Status = "canceled"; ``` ## Values ```typescript -"pending" | "approved" | "rejected" | "invited" | "declined" | "banned" +"refunded" | "duplicate" | "canceled" | "fraud" ``` \ No newline at end of file diff --git a/docs/models/operations/updatecommissionrequest.md b/docs/models/operations/updatecommissionrequest.md new file mode 100644 index 00000000..f49de762 --- /dev/null +++ b/docs/models/operations/updatecommissionrequest.md @@ -0,0 +1,18 @@ +# UpdateCommissionRequest + +## Example Usage + +```typescript +import { UpdateCommissionRequest } from "dub/models/operations"; + +let value: UpdateCommissionRequest = { + id: "cm_1JVR7XRCSR0EDBAF39FZ4PMYE", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The commission's unique ID on Dub. | cm_1JVR7XRCSR0EDBAF39FZ4PMYE | +| `requestBody` | [operations.UpdateCommissionRequestBody](../../models/operations/updatecommissionrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/updatecommissionrequestbody.md b/docs/models/operations/updatecommissionrequestbody.md new file mode 100644 index 00000000..4bafa34f --- /dev/null +++ b/docs/models/operations/updatecommissionrequestbody.md @@ -0,0 +1,18 @@ +# UpdateCommissionRequestBody + +## Example Usage + +```typescript +import { UpdateCommissionRequestBody } from "dub/models/operations"; + +let value: UpdateCommissionRequestBody = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `amount` | *number* | :heavy_minus_sign: | The new absolute amount for the sale. Paid commissions cannot be updated. | +| `modifyAmount` | *number* | :heavy_minus_sign: | Modify the current sale amount: use positive values to increase the amount, negative values to decrease it. Takes precedence over `amount`. Paid commissions cannot be updated. | +| `currency` | *string* | :heavy_minus_sign: | The currency of the sale amount to update. Accepts ISO 4217 currency codes. | +| `status` | [operations.Status](../../models/operations/status.md) | :heavy_minus_sign: | Useful for marking a commission as refunded, duplicate, canceled, or fraudulent. Takes precedence over `amount` and `modifyAmount`. When a commission is marked as refunded, duplicate, canceled, or fraudulent, it will be omitted from the payout, and the payout amount will be recalculated accordingly. Paid commissions cannot be updated. | \ No newline at end of file diff --git a/docs/models/operations/updatecommissionresponsebody.md b/docs/models/operations/updatecommissionresponsebody.md new file mode 100644 index 00000000..74a485e8 --- /dev/null +++ b/docs/models/operations/updatecommissionresponsebody.md @@ -0,0 +1,33 @@ +# UpdateCommissionResponseBody + +The updated commission. + +## Example Usage + +```typescript +import { UpdateCommissionResponseBody } from "dub/models/operations"; + +let value: UpdateCommissionResponseBody = { + id: "cm_1JVR7XRCSR0EDBAF39FZ4PMYE", + amount: 8786.35, + earnings: 1486.93, + currency: "Rand", + status: "fraud", + createdAt: "1723450687497", + updatedAt: "1748239092275", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The commission's unique ID on Dub. | cm_1JVR7XRCSR0EDBAF39FZ4PMYE | +| `type` | [operations.UpdateCommissionType](../../models/operations/updatecommissiontype.md) | :heavy_minus_sign: | N/A | | +| `amount` | *number* | :heavy_check_mark: | N/A | | +| `earnings` | *number* | :heavy_check_mark: | N/A | | +| `currency` | *string* | :heavy_check_mark: | N/A | | +| `status` | [operations.UpdateCommissionStatus](../../models/operations/updatecommissionstatus.md) | :heavy_check_mark: | N/A | | +| `invoiceId` | *string* | :heavy_minus_sign: | N/A | | +| `createdAt` | *string* | :heavy_check_mark: | N/A | | +| `updatedAt` | *string* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/updatecommissionstatus.md b/docs/models/operations/updatecommissionstatus.md new file mode 100644 index 00000000..369974ba --- /dev/null +++ b/docs/models/operations/updatecommissionstatus.md @@ -0,0 +1,15 @@ +# UpdateCommissionStatus + +## Example Usage + +```typescript +import { UpdateCommissionStatus } from "dub/models/operations"; + +let value: UpdateCommissionStatus = "refunded"; +``` + +## Values + +```typescript +"pending" | "processed" | "paid" | "refunded" | "duplicate" | "fraud" | "canceled" +``` \ No newline at end of file diff --git a/docs/models/operations/updatecommissiontype.md b/docs/models/operations/updatecommissiontype.md new file mode 100644 index 00000000..c396b227 --- /dev/null +++ b/docs/models/operations/updatecommissiontype.md @@ -0,0 +1,15 @@ +# UpdateCommissionType + +## Example Usage + +```typescript +import { UpdateCommissionType } from "dub/models/operations"; + +let value: UpdateCommissionType = "lead"; +``` + +## Values + +```typescript +"click" | "lead" | "sale" +``` \ No newline at end of file diff --git a/docs/models/operations/updatecustomerlink.md b/docs/models/operations/updatecustomerlink.md index d75e0fd8..9f8a35ca 100644 --- a/docs/models/operations/updatecustomerlink.md +++ b/docs/models/operations/updatecustomerlink.md @@ -10,6 +10,7 @@ let value: UpdateCustomerLink = { domain: "ignorant-netsuke.org", key: "", shortLink: "https://incomparable-coin.net/", + url: "https://coordinated-citizen.net/", programId: "", }; ``` @@ -22,4 +23,5 @@ let value: UpdateCustomerLink = { | `domain` | *string* | :heavy_check_mark: | The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). | | `key` | *string* | :heavy_check_mark: | The short link slug. If not provided, a random 7-character slug will be generated. | | `shortLink` | *string* | :heavy_check_mark: | The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). | +| `url` | *string* | :heavy_check_mark: | The destination URL of the short link. | | `programId` | *string* | :heavy_check_mark: | The ID of the program the short link is associated with. | \ No newline at end of file diff --git a/docs/models/operations/updatecustomerpartner.md b/docs/models/operations/updatecustomerpartner.md index 16ed8b3d..6d829db9 100644 --- a/docs/models/operations/updatecustomerpartner.md +++ b/docs/models/operations/updatecustomerpartner.md @@ -15,9 +15,9 @@ let value: UpdateCustomerPartner = { ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `email` | *string* | :heavy_check_mark: | N/A | -| `image` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The partner's unique ID on Dub. | +| `name` | *string* | :heavy_check_mark: | The partner's full legal name. | +| `email` | *string* | :heavy_check_mark: | The partner's email address. Should be a unique value across Dub. | +| `image` | *string* | :heavy_check_mark: | The partner's avatar image. | \ No newline at end of file diff --git a/docs/models/operations/updatecustomerresponsebody.md b/docs/models/operations/updatecustomerresponsebody.md index 2a45f180..e501a5ea 100644 --- a/docs/models/operations/updatecustomerresponsebody.md +++ b/docs/models/operations/updatecustomerresponsebody.md @@ -11,7 +11,7 @@ let value: UpdateCustomerResponseBody = { id: "", externalId: "", name: "", - createdAt: "1728654502270", + createdAt: "1730423570133", }; ``` @@ -25,6 +25,8 @@ let value: UpdateCustomerResponseBody = { | `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. | | `link` | [operations.UpdateCustomerLink](../../models/operations/updatecustomerlink.md) | :heavy_minus_sign: | N/A | | `programId` | *string* | :heavy_minus_sign: | N/A | diff --git a/docs/models/operations/updatepartnersalerequestbody.md b/docs/models/operations/updatepartnersalerequestbody.md deleted file mode 100644 index 18734fb6..00000000 --- a/docs/models/operations/updatepartnersalerequestbody.md +++ /dev/null @@ -1,22 +0,0 @@ -# UpdatePartnerSaleRequestBody - -## Example Usage - -```typescript -import { UpdatePartnerSaleRequestBody } from "dub/models/operations"; - -let value: UpdatePartnerSaleRequestBody = { - programId: "", - invoiceId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `programId` | *string* | :heavy_check_mark: | N/A | -| `invoiceId` | *string* | :heavy_check_mark: | N/A | -| `amount` | *number* | :heavy_minus_sign: | The new absolute amount for the sale. | -| `modifyAmount` | *number* | :heavy_minus_sign: | Modify the current sale amount: use positive values to increase the amount, negative values to decrease it. | -| `currency` | *string* | :heavy_minus_sign: | The currency of the sale amount to update. Accepts ISO 4217 currency codes. | \ No newline at end of file diff --git a/docs/models/operations/updatepartnersaleresponsebody.md b/docs/models/operations/updatepartnersaleresponsebody.md deleted file mode 100644 index ebfdfcae..00000000 --- a/docs/models/operations/updatepartnersaleresponsebody.md +++ /dev/null @@ -1,33 +0,0 @@ -# UpdatePartnerSaleResponseBody - -The updated sale. - -## Example Usage - -```typescript -import { UpdatePartnerSaleResponseBody } from "dub/models/operations"; - -let value: UpdatePartnerSaleResponseBody = { - id: "", - amount: 5954.36, - earnings: 1601.4, - currency: "Libyan Dinar", - status: "processed", - createdAt: "1746249968457", - updatedAt: "1746415086563", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | N/A | -| `type` | [operations.Type](../../models/operations/type.md) | :heavy_minus_sign: | N/A | -| `amount` | *number* | :heavy_check_mark: | N/A | -| `earnings` | *number* | :heavy_check_mark: | N/A | -| `currency` | *string* | :heavy_check_mark: | N/A | -| `status` | [operations.UpdatePartnerSaleStatus](../../models/operations/updatepartnersalestatus.md) | :heavy_check_mark: | N/A | -| `invoiceId` | *string* | :heavy_minus_sign: | N/A | -| `createdAt` | *string* | :heavy_check_mark: | N/A | -| `updatedAt` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/commissions/README.md b/docs/sdks/commissions/README.md new file mode 100644 index 00000000..703895f2 --- /dev/null +++ b/docs/sdks/commissions/README.md @@ -0,0 +1,175 @@ +# Commissions +(*commissions*) + +## Overview + +### Available Operations + +* [list](#list) - Get commissions for a program. +* [update](#update) - Update a commission. + +## list + +Retrieve a list of commissions for a program. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +const dub = new Dub({ + token: "DUB_API_KEY", +}); + +async function run() { + const result = await dub.commissions.list(); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { DubCore } from "dub/core.js"; +import { commissionsList } from "dub/funcs/commissionsList.js"; + +// Use `DubCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const dub = new DubCore({ + token: "DUB_API_KEY", +}); + +async function run() { + const res = await commissionsList(dub); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListCommissionsRequest](../../models/operations/listcommissionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.ListCommissionsResponseBody[]](../../models/.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.Conflict | 409 | application/json | +| errors.InviteExpired | 410 | application/json | +| errors.UnprocessableEntity | 422 | application/json | +| errors.RateLimitExceeded | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +Update an existing commission amount. This is useful for handling refunds (partial or full) or fraudulent sales. + +### Example Usage + +```typescript +import { Dub } from "dub"; + +const dub = new Dub({ + token: "DUB_API_KEY", +}); + +async function run() { + const result = await dub.commissions.update({ + id: "cm_1JVR7XRCSR0EDBAF39FZ4PMYE", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { DubCore } from "dub/core.js"; +import { commissionsUpdate } from "dub/funcs/commissionsUpdate.js"; + +// Use `DubCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const dub = new DubCore({ + token: "DUB_API_KEY", +}); + +async function run() { + const res = await commissionsUpdate(dub, { + id: "cm_1JVR7XRCSR0EDBAF39FZ4PMYE", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateCommissionRequest](../../models/operations/updatecommissionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.UpdateCommissionResponseBody](../../models/operations/updatecommissionresponsebody.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.BadRequest | 400 | application/json | +| errors.Unauthorized | 401 | application/json | +| errors.Forbidden | 403 | application/json | +| errors.NotFound | 404 | application/json | +| errors.Conflict | 409 | application/json | +| errors.InviteExpired | 410 | application/json | +| errors.UnprocessableEntity | 422 | application/json | +| errors.RateLimitExceeded | 429 | application/json | +| errors.InternalServerError | 500 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/partners/README.md b/docs/sdks/partners/README.md index 8a50b00e..9427fbbb 100644 --- a/docs/sdks/partners/README.md +++ b/docs/sdks/partners/README.md @@ -10,7 +10,6 @@ * [retrieveLinks](#retrievelinks) - Retrieve a partner's links. * [upsertLink](#upsertlink) - Upsert a link for a partner * [analytics](#analytics) - Retrieve analytics for a partner -* [updateSale](#updatesale) - Update a sale for a partner. ## create @@ -412,87 +411,6 @@ run(); ### Errors -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| errors.BadRequest | 400 | application/json | -| errors.Unauthorized | 401 | application/json | -| errors.Forbidden | 403 | application/json | -| errors.NotFound | 404 | application/json | -| errors.Conflict | 409 | application/json | -| errors.InviteExpired | 410 | application/json | -| errors.UnprocessableEntity | 422 | application/json | -| errors.RateLimitExceeded | 429 | application/json | -| errors.InternalServerError | 500 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## updateSale - -Update an existing sale amount. This is useful for handling refunds (partial or full) or fraudulent sales. - -### Example Usage - -```typescript -import { Dub } from "dub"; - -const dub = new Dub({ - token: "DUB_API_KEY", -}); - -async function run() { - const result = await dub.partners.updateSale(); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { DubCore } from "dub/core.js"; -import { partnersUpdateSale } from "dub/funcs/partnersUpdateSale.js"; - -// Use `DubCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const dub = new DubCore({ - token: "DUB_API_KEY", -}); - -async function run() { - const res = await partnersUpdateSale(dub); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdatePartnerSaleRequestBody](../../models/operations/updatepartnersalerequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.UpdatePartnerSaleResponseBody](../../models/operations/updatepartnersaleresponsebody.md)\>** - -### Errors - | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | errors.BadRequest | 400 | application/json | diff --git a/jsr.json b/jsr.json index bc7983f8..168e2866 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "dub", - "version": "0.61.11", + "version": "0.61.31", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 9a264039..0845ac29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dub", - "version": "0.61.11", + "version": "0.61.31", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dub", - "version": "0.61.11", + "version": "0.61.31", "bin": { "mcp": "bin/mcp-server.js" }, @@ -5708,9 +5708,9 @@ } }, "node_modules/zod": { - "version": "3.24.2", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", - "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", + "version": "3.25.28", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.28.tgz", + "integrity": "sha512-/nt/67WYKnr5by3YS7LroZJbtcCBurDKKPBPWWzaxvVCGuG/NOsiKkrjoOhI8mJ+SQUXEbUzeB3S+6XDUEEj7Q==", "dev": true, "license": "MIT", "funding": { diff --git a/package.json b/package.json index 9cdbace2..dfbb3e7f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dub", - "version": "0.61.11", + "version": "0.61.31", "author": "Dub", "type": "module", "bin": { @@ -27,6 +27,8 @@ "url": "https://github.com/dubinc/dub-ts.git" }, "scripts": { + "test": "vitest run src --reporter=junit --outputFile=.speakeasy/reports/tests.xml --reporter=default", + "check": "npm run test && npm run lint", "lint": "eslint --cache --max-warnings=0 src", "build:mcp": "bun src/mcp-server/build.mts", "build": "npm run build:mcp && tshy", diff --git a/src/__tests__/assertions.ts b/src/__tests__/assertions.ts new file mode 100644 index 00000000..c05351d0 --- /dev/null +++ b/src/__tests__/assertions.ts @@ -0,0 +1,13 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { fail } from "assert"; + +export function assertDefined(value: any): any { + if (value === undefined) { + fail("value is undefined"); + } + + return value; +} diff --git a/src/__tests__/files.ts b/src/__tests__/files.ts new file mode 100644 index 00000000..f1df32f8 --- /dev/null +++ b/src/__tests__/files.ts @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { createReadStream } from "node:fs"; +import { readFile } from "node:fs/promises"; +import { Readable } from "node:stream"; + +export function filesToStream(filePath: string): ReadableStream { + return Readable.toWeb( + createReadStream(filePath), + ) as unknown as ReadableStream; +} + +export async function filesToByteArray(filePath: string): Promise { + return new Uint8Array(await readFile(filePath)); +} + +export async function filesToString(filePath: string): Promise { + return readFile(filePath, "utf8"); +} + +export async function streamToByteArray( + stream?: ReadableStream, +): Promise { + if (!stream) { + return Buffer.from(""); + } + + const chunks = []; + const reader = stream.getReader(); + + let done = false; + while (!done) { + const res = await reader.read(); + done = res.done; + if (res.value) { + chunks.push(res.value); + } + } + + return Buffer.concat(chunks); +} + +export function bytesToStream(bytes: Uint8Array): ReadableStream { + return new ReadableStream({ + start(controller) { + controller.enqueue(bytes); + }, + pull(controller) { + controller.close(); + }, + cancel() { + }, + }); +} diff --git a/src/__tests__/tags.test.ts b/src/__tests__/tags.test.ts new file mode 100644 index 00000000..a1cec1a6 --- /dev/null +++ b/src/__tests__/tags.test.ts @@ -0,0 +1,89 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { expect, test } from "vitest"; +import { Dub } from "../index.js"; +import { createTestHTTPClient } from "./testclient.js"; + +test("Tags Create Tag", async () => { + const testHttpClient = createTestHTTPClient("createTag"); + + const dub = new Dub({ + serverURL: "http://api.localhost:8888", + token: process.env["DUB_API_KEY"] ?? "value", + httpClient: testHttpClient, + }); + + const result = await dub.tags.create(); + expect(result).toBeDefined(); + expect(result).toEqual({ + id: "", + name: "", + color: "blue", + }); +}); + +test("Tags Get Tags", async () => { + const testHttpClient = createTestHTTPClient("getTags"); + + const dub = new Dub({ + serverURL: "http://api.localhost:8888", + token: process.env["DUB_API_KEY"] ?? "value", + httpClient: testHttpClient, + }); + + const result = await dub.tags.list(); + expect(result).toBeDefined(); + expect(result).toEqual([ + { + id: "", + name: "", + color: "blue", + }, + { + id: "", + name: "", + color: "purple", + }, + { + id: "", + name: "", + color: "yellow", + }, + ]); +}); + +test("Tags Update Tag", async () => { + const testHttpClient = createTestHTTPClient("updateTag"); + + const dub = new Dub({ + serverURL: "http://api.localhost:8888", + token: process.env["DUB_API_KEY"] ?? "value", + httpClient: testHttpClient, + }); + + const result = await dub.tags.update(""); + expect(result).toBeDefined(); + expect(result).toEqual({ + id: "", + name: "", + color: "brown", + }); +}); + +test("Tags Delete Tag", async () => { + const testHttpClient = createTestHTTPClient("deleteTag"); + + const dub = new Dub({ + serverURL: "http://api.localhost:8888", + token: process.env["DUB_API_KEY"] ?? "value", + httpClient: testHttpClient, + }); + + const result = await dub.tags.delete(""); + expect(result).toBeDefined(); + expect(result).toEqual({ + id: "", + }); +}); diff --git a/src/__tests__/testclient.ts b/src/__tests__/testclient.ts new file mode 100644 index 00000000..0dd5b597 --- /dev/null +++ b/src/__tests__/testclient.ts @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { getRandomValues } from "crypto"; +import { HTTPClient } from "../lib/http.js"; + +export function createTestHTTPClient(testName: string): HTTPClient { + const httpClient = new HTTPClient({ + fetcher: (request: URL | RequestInfo) => { + return fetch(request); + }, + }); + + const testInstanceId = genTestId(); + + httpClient.addHook("beforeRequest", (request: Request) => { + const nextRequest = new Request(request, { + signal: request.signal || AbortSignal.timeout(5000), + }); + + nextRequest.headers.set("x-speakeasy-test-name", testName); + nextRequest.headers.set("x-speakeasy-test-instance-id", testInstanceId); + + return nextRequest; + }); + + return httpClient; +} + +function genTestId(): string { + const b = new Uint8Array(16); + getRandomValues(b); + + return `${buf2hex(b.slice(0, 4))}-${buf2hex(b.slice(4, 6))}-${ + buf2hex( + b.slice(6, 8), + ) + }-${buf2hex(b.slice(8, 10))}-${buf2hex(b.slice(10))}`; +} + +// Helper function to convert buffer to hex string +function buf2hex(buffer: Uint8Array): string { + return [...buffer] + .map((x) => x.toString(16).padStart(2, "0")) + .join("") + .toUpperCase(); +} diff --git a/src/funcs/commissionsList.ts b/src/funcs/commissionsList.ts new file mode 100644 index 00000000..d7ca3229 --- /dev/null +++ b/src/funcs/commissionsList.ts @@ -0,0 +1,225 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { DubCore } from "../core.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get commissions for a program. + * + * @remarks + * Retrieve a list of commissions for a program. + */ +export function commissionsList( + client: DubCore, + request?: operations.ListCommissionsRequest | undefined, + options?: RequestOptions, +): APIPromise< + Result< + Array, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.Conflict + | errors.InviteExpired + | errors.UnprocessableEntity + | errors.RateLimitExceeded + | errors.InternalServerError + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: DubCore, + request?: operations.ListCommissionsRequest | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + Array, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.Conflict + | errors.InviteExpired + | errors.UnprocessableEntity + | errors.RateLimitExceeded + | errors.InternalServerError + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.ListCommissionsRequest$outboundSchema.optional().parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/commissions")(); + + const query = encodeFormQuery({ + "customerId": payload?.customerId, + "end": payload?.end, + "interval": payload?.interval, + "invoiceId": payload?.invoiceId, + "page": payload?.page, + "pageSize": payload?.pageSize, + "partnerId": payload?.partnerId, + "payoutId": payload?.payoutId, + "sortBy": payload?.sortBy, + "sortOrder": payload?.sortOrder, + "start": payload?.start, + "status": payload?.status, + "type": payload?.type, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.token); + const securityInput = secConfig == null ? {} : { token: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "listCommissions", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.token, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: [ + "400", + "401", + "403", + "404", + "409", + "410", + "422", + "429", + "4XX", + "500", + "5XX", + ], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + Array, + | errors.BadRequest + | errors.Unauthorized + | errors.Forbidden + | errors.NotFound + | errors.Conflict + | errors.InviteExpired + | errors.UnprocessableEntity + | errors.RateLimitExceeded + | errors.InternalServerError + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json(200, z.array(operations.ListCommissionsResponseBody$inboundSchema)), + M.jsonErr(400, errors.BadRequest$inboundSchema), + M.jsonErr(401, errors.Unauthorized$inboundSchema), + M.jsonErr(403, errors.Forbidden$inboundSchema), + M.jsonErr(404, errors.NotFound$inboundSchema), + M.jsonErr(409, errors.Conflict$inboundSchema), + M.jsonErr(410, errors.InviteExpired$inboundSchema), + M.jsonErr(422, errors.UnprocessableEntity$inboundSchema), + M.jsonErr(429, errors.RateLimitExceeded$inboundSchema), + M.jsonErr(500, errors.InternalServerError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/partnersUpdateSale.ts b/src/funcs/commissionsUpdate.ts similarity index 84% rename from src/funcs/partnersUpdateSale.ts rename to src/funcs/commissionsUpdate.ts index a0b31e6a..b3b11d49 100644 --- a/src/funcs/partnersUpdateSale.ts +++ b/src/funcs/commissionsUpdate.ts @@ -3,7 +3,7 @@ */ import { DubCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; import * as M from "../lib/matchers.js"; import { compactMap } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; @@ -25,18 +25,18 @@ import { APICall, APIPromise } from "../types/async.js"; import { Result } from "../types/fp.js"; /** - * Update a sale for a partner. + * Update a commission. * * @remarks - * Update an existing sale amount. This is useful for handling refunds (partial or full) or fraudulent sales. + * Update an existing commission amount. This is useful for handling refunds (partial or full) or fraudulent sales. */ -export function partnersUpdateSale( +export function commissionsUpdate( client: DubCore, - request?: operations.UpdatePartnerSaleRequestBody | undefined, + request: operations.UpdateCommissionRequest, options?: RequestOptions, ): APIPromise< Result< - operations.UpdatePartnerSaleResponseBody, + operations.UpdateCommissionResponseBody, | errors.BadRequest | errors.Unauthorized | errors.Forbidden @@ -64,12 +64,12 @@ export function partnersUpdateSale( async function $do( client: DubCore, - request?: operations.UpdatePartnerSaleRequestBody | undefined, + request: operations.UpdateCommissionRequest, options?: RequestOptions, ): Promise< [ Result< - operations.UpdatePartnerSaleResponseBody, + operations.UpdateCommissionResponseBody, | errors.BadRequest | errors.Unauthorized | errors.Forbidden @@ -92,21 +92,23 @@ async function $do( > { const parsed = safeParse( request, - (value) => - operations.UpdatePartnerSaleRequestBody$outboundSchema.optional().parse( - value, - ), + (value) => operations.UpdateCommissionRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { return [parsed, { status: "invalid" }]; } const payload = parsed.value; - const body = payload === undefined - ? null - : encodeJSON("body", payload, { explode: true }); + const body = encodeJSON("body", payload.RequestBody, { explode: true }); - const path = pathToFunc("/partners/sales")(); + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/commissions/{id}")(pathParams); const headers = new Headers(compactMap({ "Content-Type": "application/json", @@ -119,7 +121,7 @@ async function $do( const context = { baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "updatePartnerSale", + operationID: "updateCommission", oAuth2Scopes: [], resolvedSecurity: requestSecurity, @@ -173,7 +175,7 @@ async function $do( }; const [result] = await M.match< - operations.UpdatePartnerSaleResponseBody, + operations.UpdateCommissionResponseBody, | errors.BadRequest | errors.Unauthorized | errors.Forbidden @@ -191,7 +193,7 @@ async function $do( | RequestTimeoutError | ConnectionError >( - M.json(200, operations.UpdatePartnerSaleResponseBody$inboundSchema), + M.json(200, operations.UpdateCommissionResponseBody$inboundSchema), M.jsonErr(400, errors.BadRequest$inboundSchema), M.jsonErr(401, errors.Unauthorized$inboundSchema), M.jsonErr(403, errors.Forbidden$inboundSchema), diff --git a/src/funcs/customersList.ts b/src/funcs/customersList.ts index 6104533d..a609a288 100644 --- a/src/funcs/customersList.ts +++ b/src/funcs/customersList.ts @@ -106,12 +106,16 @@ async function $do( const path = pathToFunc("/customers")(); const query = encodeFormQuery({ + "country": payload?.country, "email": payload?.email, "externalId": payload?.externalId, "includeExpandedFields": payload?.includeExpandedFields, + "linkId": payload?.linkId, "page": payload?.page, "pageSize": payload?.pageSize, "search": payload?.search, + "sortBy": payload?.sortBy, + "sortOrder": payload?.sortOrder, }); const headers = new Headers(compactMap({ diff --git a/src/funcs/linksCount.ts b/src/funcs/linksCount.ts index 7ed94302..0ede83cd 100644 --- a/src/funcs/linksCount.ts +++ b/src/funcs/linksCount.ts @@ -4,7 +4,7 @@ import * as z from "zod"; import { DubCore } from "../core.js"; -import { encodeFormQuery } from "../lib/encodings.js"; +import { encodeFormQuery, queryJoin } from "../lib/encodings.js"; import * as M from "../lib/matchers.js"; import { compactMap } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; @@ -105,19 +105,23 @@ async function $do( const path = pathToFunc("/links/count")(); - const query = encodeFormQuery({ - "domain": payload?.domain, - "folderId": payload?.folderId, - "groupBy": payload?.groupBy, - "search": payload?.search, - "showArchived": payload?.showArchived, - "tagId": payload?.tagId, - "tagIds": payload?.tagIds, - "tagNames": payload?.tagNames, - "tenantId": payload?.tenantId, - "userId": payload?.userId, - "withTags": payload?.withTags, - }); + const query = queryJoin( + encodeFormQuery({ + "tagIds": payload?.tagIds, + "tagNames": payload?.tagNames, + }, { explode: false }), + encodeFormQuery({ + "domain": payload?.domain, + "folderId": payload?.folderId, + "groupBy": payload?.groupBy, + "search": payload?.search, + "showArchived": payload?.showArchived, + "tagId": payload?.tagId, + "tenantId": payload?.tenantId, + "userId": payload?.userId, + "withTags": payload?.withTags, + }), + ); const headers = new Headers(compactMap({ Accept: "application/json", diff --git a/src/funcs/linksList.ts b/src/funcs/linksList.ts index a883a0e4..a8886f66 100644 --- a/src/funcs/linksList.ts +++ b/src/funcs/linksList.ts @@ -3,7 +3,7 @@ */ import { DubCore } from "../core.js"; -import { encodeFormQuery } from "../lib/encodings.js"; +import { encodeFormQuery, queryJoin } from "../lib/encodings.js"; import * as M from "../lib/matchers.js"; import { compactMap } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; @@ -116,23 +116,27 @@ async function $do( const path = pathToFunc("/links")(); - const query = encodeFormQuery({ - "domain": payload?.domain, - "folderId": payload?.folderId, - "page": payload?.page, - "pageSize": payload?.pageSize, - "search": payload?.search, - "showArchived": payload?.showArchived, - "sort": payload?.sort, - "sortBy": payload?.sortBy, - "sortOrder": payload?.sortOrder, - "tagId": payload?.tagId, - "tagIds": payload?.tagIds, - "tagNames": payload?.tagNames, - "tenantId": payload?.tenantId, - "userId": payload?.userId, - "withTags": payload?.withTags, - }); + const query = queryJoin( + encodeFormQuery({ + "tagIds": payload?.tagIds, + "tagNames": payload?.tagNames, + }, { explode: false }), + encodeFormQuery({ + "domain": payload?.domain, + "folderId": payload?.folderId, + "page": payload?.page, + "pageSize": payload?.pageSize, + "search": payload?.search, + "showArchived": payload?.showArchived, + "sort": payload?.sort, + "sortBy": payload?.sortBy, + "sortOrder": payload?.sortOrder, + "tagId": payload?.tagId, + "tenantId": payload?.tenantId, + "userId": payload?.userId, + "withTags": payload?.withTags, + }), + ); const headers = new Headers(compactMap({ Accept: "application/json", diff --git a/src/lib/config.ts b/src/lib/config.ts index 726920fb..066622ef 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -57,7 +57,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.1", - sdkVersion: "0.61.11", - genVersion: "2.597.9", - userAgent: "speakeasy-sdk/typescript 0.61.11 2.597.9 0.0.1 dub", + sdkVersion: "0.61.31", + genVersion: "2.598.22", + userAgent: "speakeasy-sdk/typescript 0.61.31 2.598.22 0.0.1 dub", } as const; diff --git a/src/mcp-server/mcp-server.ts b/src/mcp-server/mcp-server.ts index c4e3a749..f41678e4 100644 --- a/src/mcp-server/mcp-server.ts +++ b/src/mcp-server/mcp-server.ts @@ -19,7 +19,7 @@ const routes = buildRouteMap({ export const app = buildApplication(routes, { name: "mcp", versionInfo: { - currentVersion: "0.61.11", + currentVersion: "0.61.31", }, }); diff --git a/src/mcp-server/server.ts b/src/mcp-server/server.ts index 738985b7..068d3871 100644 --- a/src/mcp-server/server.ts +++ b/src/mcp-server/server.ts @@ -14,6 +14,8 @@ import { import { MCPScope } from "./scopes.js"; import { createRegisterTool } from "./tools.js"; import { tool$analyticsRetrieve } from "./tools/analyticsRetrieve.js"; +import { tool$commissionsList } from "./tools/commissionsList.js"; +import { tool$commissionsUpdate } from "./tools/commissionsUpdate.js"; import { tool$customersCreate } from "./tools/customersCreate.js"; import { tool$customersDelete } from "./tools/customersDelete.js"; import { tool$customersGet } from "./tools/customersGet.js"; @@ -43,7 +45,6 @@ import { tool$partnersAnalytics } from "./tools/partnersAnalytics.js"; import { tool$partnersCreate } from "./tools/partnersCreate.js"; import { tool$partnersCreateLink } from "./tools/partnersCreateLink.js"; import { tool$partnersRetrieveLinks } from "./tools/partnersRetrieveLinks.js"; -import { tool$partnersUpdateSale } from "./tools/partnersUpdateSale.js"; import { tool$partnersUpsertLink } from "./tools/partnersUpsertLink.js"; import { tool$qrCodesGet } from "./tools/qrCodesGet.js"; import { tool$tagsCreate } from "./tools/tagsCreate.js"; @@ -65,7 +66,7 @@ export function createMCPServer(deps: { }) { const server = new McpServer({ name: "Dub", - version: "0.61.11", + version: "0.61.31", }); const client = new DubCore({ @@ -131,7 +132,8 @@ export function createMCPServer(deps: { tool(tool$partnersRetrieveLinks); tool(tool$partnersUpsertLink); tool(tool$partnersAnalytics); - tool(tool$partnersUpdateSale); + tool(tool$commissionsList); + tool(tool$commissionsUpdate); tool(tool$workspacesGet); tool(tool$workspacesUpdate); tool(tool$embedTokensReferrals); diff --git a/src/mcp-server/tools/partnersUpdateSale.ts b/src/mcp-server/tools/commissionsList.ts similarity index 56% rename from src/mcp-server/tools/partnersUpdateSale.ts rename to src/mcp-server/tools/commissionsList.ts index 71d12a4d..5631f7d1 100644 --- a/src/mcp-server/tools/partnersUpdateSale.ts +++ b/src/mcp-server/tools/commissionsList.ts @@ -2,22 +2,22 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { partnersUpdateSale } from "../../funcs/partnersUpdateSale.js"; +import { commissionsList } from "../../funcs/commissionsList.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { - request: operations.UpdatePartnerSaleRequestBody$inboundSchema.optional(), + request: operations.ListCommissionsRequest$inboundSchema.optional(), }; -export const tool$partnersUpdateSale: ToolDefinition = { - name: "partners-update-sale", - description: `Update a sale for a partner. +export const tool$commissionsList: ToolDefinition = { + name: "commissions-list", + description: `Get commissions for a program. -Update an existing sale amount. This is useful for handling refunds (partial or full) or fraudulent sales.`, +Retrieve a list of commissions for a program.`, args, tool: async (client, args, ctx) => { - const [result, apiCall] = await partnersUpdateSale( + const [result, apiCall] = await commissionsList( client, args.request, { fetchOptions: { signal: ctx.signal } }, diff --git a/src/mcp-server/tools/commissionsUpdate.ts b/src/mcp-server/tools/commissionsUpdate.ts new file mode 100644 index 00000000..5992938b --- /dev/null +++ b/src/mcp-server/tools/commissionsUpdate.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { commissionsUpdate } from "../../funcs/commissionsUpdate.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.UpdateCommissionRequest$inboundSchema, +}; + +export const tool$commissionsUpdate: ToolDefinition = { + name: "commissions-update", + description: `Update a commission. + +Update an existing commission amount. This is useful for handling refunds (partial or full) or fraudulent sales.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await commissionsUpdate( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/models/components/leadcreatedevent.ts b/src/models/components/leadcreatedevent.ts index 7de699af..89a526d6 100644 --- a/src/models/components/leadcreatedevent.ts +++ b/src/models/components/leadcreatedevent.ts @@ -45,6 +45,14 @@ export type LeadCreatedEventCustomer = { * Country of the customer. */ country?: string | null | undefined; + /** + * Total number of sales for the customer. + */ + sales?: number | null | undefined; + /** + * Total amount of sales for the customer. + */ + saleAmount?: number | null | undefined; /** * The date the customer was created. */ @@ -537,6 +545,8 @@ export const LeadCreatedEventCustomer$inboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), }); @@ -548,6 +558,8 @@ export type LeadCreatedEventCustomer$Outbound = { email?: string | null | undefined; avatar?: string | null | undefined; country?: string | null | undefined; + sales?: number | null | undefined; + saleAmount?: number | null | undefined; createdAt: string; }; @@ -563,6 +575,8 @@ export const LeadCreatedEventCustomer$outboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), }); diff --git a/src/models/components/leadevent.ts b/src/models/components/leadevent.ts index 36613732..97510743 100644 --- a/src/models/components/leadevent.ts +++ b/src/models/components/leadevent.ts @@ -481,6 +481,14 @@ export type Customer = { * Country of the customer. */ country?: string | null | undefined; + /** + * Total number of sales for the customer. + */ + sales?: number | null | undefined; + /** + * Total amount of sales for the customer. + */ + saleAmount?: number | null | undefined; /** * The date the customer was created. */ @@ -2271,6 +2279,8 @@ export const Customer$inboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), }); @@ -2282,6 +2292,8 @@ export type Customer$Outbound = { email?: string | null | undefined; avatar?: string | null | undefined; country?: string | null | undefined; + sales?: number | null | undefined; + saleAmount?: number | null | undefined; createdAt: string; }; @@ -2297,6 +2309,8 @@ export const Customer$outboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), }); diff --git a/src/models/components/partnerenrolledevent.ts b/src/models/components/partnerenrolledevent.ts index 03ac3774..0f4049f7 100644 --- a/src/models/components/partnerenrolledevent.ts +++ b/src/models/components/partnerenrolledevent.ts @@ -15,6 +15,9 @@ export type PartnerEnrolledEventEvent = ClosedEnum< typeof PartnerEnrolledEventEvent >; +/** + * The status of the partner's enrollment in the program. + */ export const Status = { Pending: "pending", Approved: "approved", @@ -23,6 +26,9 @@ export const Status = { Declined: "declined", Banned: "banned", } as const; +/** + * The status of the partner's enrollment in the program. + */ export type Status = ClosedEnum; export type PartnerEnrolledEventLink = { @@ -65,25 +71,109 @@ export type PartnerEnrolledEventLink = { }; export type PartnerEnrolledEventData = { + /** + * The partner's unique ID on Dub. + */ id: string; + /** + * The partner's full legal name. + */ name: string; + /** + * The partner's email address. Should be a unique value across Dub. + */ email: string | null; + /** + * The partner's avatar image. + */ image: string | null; + /** + * A brief description of the partner and their background. + */ description?: string | null | undefined; + /** + * The partner's country (required for tax purposes). + */ country: string | null; + /** + * The partner's website URL (including the https protocol). + */ + website: string | null; + /** + * The partner's YouTube channel username (e.g. `johndoe`). + */ + youtube: string | null; + /** + * The partner's Twitter username (e.g. `johndoe`). + */ + twitter: string | null; + /** + * The partner's LinkedIn username (e.g. `johndoe`). + */ + linkedin: string | null; + /** + * The partner's Instagram username (e.g. `johndoe`). + */ + instagram: string | null; + /** + * The partner's TikTok username (e.g. `johndoe`). + */ + tiktok: string | null; + /** + * The partner's PayPal email (for receiving payouts via PayPal). + */ paypalEmail: string | null; + /** + * The partner's Stripe Connect ID (for receiving payouts via Stripe). + */ stripeConnectId: string | null; + /** + * The date when the partner enabled payouts. + */ payoutsEnabledAt: string | null; + /** + * The date when the partner was created on Dub. + */ createdAt: string; + /** + * The status of the partner's enrollment in the program. + */ status: Status; + /** + * The program's unique ID on Dub. + */ programId: string; + /** + * The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future. + */ tenantId: string | null; + /** + * The partner's referral links in this program. + */ links: Array | null; + /** + * The total number of clicks on the partner's links. + */ clicks?: number | undefined; + /** + * The total number of leads generated by the partner's links. + */ leads?: number | undefined; + /** + * The total number of sales generated by the partner's links. + */ sales?: number | undefined; + /** + * The total amount of sales (in cents) generated by the partner's links. + */ saleAmount?: number | undefined; + /** + * The total earnings/commissions accrued by the partner's links. + */ earnings?: number | undefined; + /** + * If the partner submitted an application to join the program, this is the ID of the application. + */ applicationId?: string | null | undefined; }; @@ -227,6 +317,12 @@ export const PartnerEnrolledEventData$inboundSchema: z.ZodType< image: z.nullable(z.string()), description: z.nullable(z.string()).optional(), country: z.nullable(z.string()), + website: z.nullable(z.string()), + youtube: z.nullable(z.string()), + twitter: z.nullable(z.string()), + linkedin: z.nullable(z.string()), + instagram: z.nullable(z.string()), + tiktok: z.nullable(z.string()), paypalEmail: z.nullable(z.string()), stripeConnectId: z.nullable(z.string()), payoutsEnabledAt: z.nullable(z.string()), @@ -253,6 +349,12 @@ export type PartnerEnrolledEventData$Outbound = { image: string | null; description?: string | null | undefined; country: string | null; + website: string | null; + youtube: string | null; + twitter: string | null; + linkedin: string | null; + instagram: string | null; + tiktok: string | null; paypalEmail: string | null; stripeConnectId: string | null; payoutsEnabledAt: string | null; @@ -281,6 +383,12 @@ export const PartnerEnrolledEventData$outboundSchema: z.ZodType< image: z.nullable(z.string()), description: z.nullable(z.string()).optional(), country: z.nullable(z.string()), + website: z.nullable(z.string()), + youtube: z.nullable(z.string()), + twitter: z.nullable(z.string()), + linkedin: z.nullable(z.string()), + instagram: z.nullable(z.string()), + tiktok: z.nullable(z.string()), paypalEmail: z.nullable(z.string()), stripeConnectId: z.nullable(z.string()), payoutsEnabledAt: z.nullable(z.string()), diff --git a/src/models/components/salecreatedevent.ts b/src/models/components/salecreatedevent.ts index 983cab9c..e2d436cc 100644 --- a/src/models/components/salecreatedevent.ts +++ b/src/models/components/salecreatedevent.ts @@ -45,6 +45,14 @@ export type SaleCreatedEventCustomer = { * Country of the customer. */ country?: string | null | undefined; + /** + * Total number of sales for the customer. + */ + sales?: number | null | undefined; + /** + * Total amount of sales for the customer. + */ + saleAmount?: number | null | undefined; /** * The date the customer was created. */ @@ -545,6 +553,8 @@ export const SaleCreatedEventCustomer$inboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), }); @@ -556,6 +566,8 @@ export type SaleCreatedEventCustomer$Outbound = { email?: string | null | undefined; avatar?: string | null | undefined; country?: string | null | undefined; + sales?: number | null | undefined; + saleAmount?: number | null | undefined; createdAt: string; }; @@ -571,6 +583,8 @@ export const SaleCreatedEventCustomer$outboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), }); diff --git a/src/models/components/saleevent.ts b/src/models/components/saleevent.ts index bcc87bb5..676224cd 100644 --- a/src/models/components/saleevent.ts +++ b/src/models/components/saleevent.ts @@ -481,6 +481,14 @@ export type SaleEventCustomer = { * Country of the customer. */ country?: string | null | undefined; + /** + * Total number of sales for the customer. + */ + sales?: number | null | undefined; + /** + * Total amount of sales for the customer. + */ + saleAmount?: number | null | undefined; /** * The date the customer was created. */ @@ -2318,6 +2326,8 @@ export const SaleEventCustomer$inboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), }); @@ -2329,6 +2339,8 @@ export type SaleEventCustomer$Outbound = { email?: string | null | undefined; avatar?: string | null | undefined; country?: string | null | undefined; + sales?: number | null | undefined; + saleAmount?: number | null | undefined; createdAt: string; }; @@ -2344,6 +2356,8 @@ export const SaleEventCustomer$outboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), }); diff --git a/src/models/operations/createcustomer.ts b/src/models/operations/createcustomer.ts index a3699740..f3698419 100644 --- a/src/models/operations/createcustomer.ts +++ b/src/models/operations/createcustomer.ts @@ -44,6 +44,10 @@ export type CreateCustomerLink = { * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). */ shortLink: string; + /** + * The destination URL of the short link. + */ + url: string; /** * The ID of the program the short link is associated with. */ @@ -51,9 +55,21 @@ export type CreateCustomerLink = { }; export type CreateCustomerPartner = { + /** + * The partner's unique ID on Dub. + */ id: string; + /** + * The partner's full legal name. + */ name: string; + /** + * The partner's email address. Should be a unique value across Dub. + */ email: string | null; + /** + * The partner's avatar image. + */ image: string | null; }; @@ -102,6 +118,14 @@ export type CreateCustomerResponseBody = { * Country of the customer. */ country?: string | null | undefined; + /** + * Total number of sales for the customer. + */ + sales?: number | null | undefined; + /** + * Total amount of sales for the customer. + */ + saleAmount?: number | null | undefined; /** * The date the customer was created. */ @@ -185,6 +209,7 @@ export const CreateCustomerLink$inboundSchema: z.ZodType< domain: z.string(), key: z.string(), shortLink: z.string(), + url: z.string(), programId: z.nullable(z.string()), }); @@ -194,6 +219,7 @@ export type CreateCustomerLink$Outbound = { domain: string; key: string; shortLink: string; + url: string; programId: string | null; }; @@ -207,6 +233,7 @@ export const CreateCustomerLink$outboundSchema: z.ZodType< domain: z.string(), key: z.string(), shortLink: z.string(), + url: z.string(), programId: z.nullable(z.string()), }); @@ -412,6 +439,8 @@ export const CreateCustomerResponseBody$inboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), link: z.nullable(z.lazy(() => CreateCustomerLink$inboundSchema)).optional(), programId: z.nullable(z.string()).optional(), @@ -429,6 +458,8 @@ export type CreateCustomerResponseBody$Outbound = { email?: string | null | undefined; avatar?: string | null | undefined; country?: string | null | undefined; + sales?: number | null | undefined; + saleAmount?: number | null | undefined; createdAt: string; link?: CreateCustomerLink$Outbound | null | undefined; programId?: string | null | undefined; @@ -448,6 +479,8 @@ export const CreateCustomerResponseBody$outboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), link: z.nullable(z.lazy(() => CreateCustomerLink$outboundSchema)).optional(), programId: z.nullable(z.string()).optional(), diff --git a/src/models/operations/createpartner.ts b/src/models/operations/createpartner.ts index cb91fe46..679d543e 100644 --- a/src/models/operations/createpartner.ts +++ b/src/models/operations/createpartner.ts @@ -445,7 +445,10 @@ export type CreatePartnerRequestBody = { linkProps?: LinkProps | undefined; }; -export const Status = { +/** + * The status of the partner's enrollment in the program. + */ +export const CreatePartnerStatus = { Pending: "pending", Approved: "approved", Rejected: "rejected", @@ -453,7 +456,10 @@ export const Status = { Declined: "declined", Banned: "banned", } as const; -export type Status = ClosedEnum; +/** + * The status of the partner's enrollment in the program. + */ +export type CreatePartnerStatus = ClosedEnum; export type CreatePartnerLink = { /** @@ -498,25 +504,109 @@ export type CreatePartnerLink = { * The created partner */ export type CreatePartnerResponseBody = { + /** + * The partner's unique ID on Dub. + */ id: string; + /** + * The partner's full legal name. + */ name: string; + /** + * The partner's email address. Should be a unique value across Dub. + */ email: string | null; + /** + * The partner's avatar image. + */ image: string | null; + /** + * A brief description of the partner and their background. + */ description?: string | null | undefined; + /** + * The partner's country (required for tax purposes). + */ country: string | null; + /** + * The partner's website URL (including the https protocol). + */ + website: string | null; + /** + * The partner's YouTube channel username (e.g. `johndoe`). + */ + youtube: string | null; + /** + * The partner's Twitter username (e.g. `johndoe`). + */ + twitter: string | null; + /** + * The partner's LinkedIn username (e.g. `johndoe`). + */ + linkedin: string | null; + /** + * The partner's Instagram username (e.g. `johndoe`). + */ + instagram: string | null; + /** + * The partner's TikTok username (e.g. `johndoe`). + */ + tiktok: string | null; + /** + * The partner's PayPal email (for receiving payouts via PayPal). + */ paypalEmail: string | null; + /** + * The partner's Stripe Connect ID (for receiving payouts via Stripe). + */ stripeConnectId: string | null; + /** + * The date when the partner enabled payouts. + */ payoutsEnabledAt: string | null; + /** + * The date when the partner was created on Dub. + */ createdAt: string; - status: Status; + /** + * The status of the partner's enrollment in the program. + */ + status: CreatePartnerStatus; + /** + * The program's unique ID on Dub. + */ programId: string; + /** + * The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future. + */ tenantId: string | null; + /** + * The partner's referral links in this program. + */ links: Array | null; + /** + * The total number of clicks on the partner's links. + */ clicks?: number | undefined; + /** + * The total number of leads generated by the partner's links. + */ leads?: number | undefined; + /** + * The total number of sales generated by the partner's links. + */ sales?: number | undefined; + /** + * The total amount of sales (in cents) generated by the partner's links. + */ saleAmount?: number | undefined; + /** + * The total earnings/commissions accrued by the partner's links. + */ earnings?: number | undefined; + /** + * If the partner submitted an application to join the program, this is the ID of the application. + */ applicationId?: string | null | undefined; }; @@ -925,22 +1015,24 @@ export function createPartnerRequestBodyFromJSON( } /** @internal */ -export const Status$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(Status); +export const CreatePartnerStatus$inboundSchema: z.ZodNativeEnum< + typeof CreatePartnerStatus +> = z.nativeEnum(CreatePartnerStatus); /** @internal */ -export const Status$outboundSchema: z.ZodNativeEnum = - Status$inboundSchema; +export const CreatePartnerStatus$outboundSchema: z.ZodNativeEnum< + typeof CreatePartnerStatus +> = CreatePartnerStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Status$ { - /** @deprecated use `Status$inboundSchema` instead. */ - export const inboundSchema = Status$inboundSchema; - /** @deprecated use `Status$outboundSchema` instead. */ - export const outboundSchema = Status$outboundSchema; +export namespace CreatePartnerStatus$ { + /** @deprecated use `CreatePartnerStatus$inboundSchema` instead. */ + export const inboundSchema = CreatePartnerStatus$inboundSchema; + /** @deprecated use `CreatePartnerStatus$outboundSchema` instead. */ + export const outboundSchema = CreatePartnerStatus$outboundSchema; } /** @internal */ @@ -1033,11 +1125,17 @@ export const CreatePartnerResponseBody$inboundSchema: z.ZodType< image: z.nullable(z.string()), description: z.nullable(z.string()).optional(), country: z.nullable(z.string()), + website: z.nullable(z.string()), + youtube: z.nullable(z.string()), + twitter: z.nullable(z.string()), + linkedin: z.nullable(z.string()), + instagram: z.nullable(z.string()), + tiktok: z.nullable(z.string()), paypalEmail: z.nullable(z.string()), stripeConnectId: z.nullable(z.string()), payoutsEnabledAt: z.nullable(z.string()), createdAt: z.string(), - status: Status$inboundSchema, + status: CreatePartnerStatus$inboundSchema, programId: z.string(), tenantId: z.nullable(z.string()), links: z.nullable(z.array(z.lazy(() => CreatePartnerLink$inboundSchema))), @@ -1057,6 +1155,12 @@ export type CreatePartnerResponseBody$Outbound = { image: string | null; description?: string | null | undefined; country: string | null; + website: string | null; + youtube: string | null; + twitter: string | null; + linkedin: string | null; + instagram: string | null; + tiktok: string | null; paypalEmail: string | null; stripeConnectId: string | null; payoutsEnabledAt: string | null; @@ -1085,11 +1189,17 @@ export const CreatePartnerResponseBody$outboundSchema: z.ZodType< image: z.nullable(z.string()), description: z.nullable(z.string()).optional(), country: z.nullable(z.string()), + website: z.nullable(z.string()), + youtube: z.nullable(z.string()), + twitter: z.nullable(z.string()), + linkedin: z.nullable(z.string()), + instagram: z.nullable(z.string()), + tiktok: z.nullable(z.string()), paypalEmail: z.nullable(z.string()), stripeConnectId: z.nullable(z.string()), payoutsEnabledAt: z.nullable(z.string()), createdAt: z.string(), - status: Status$outboundSchema, + status: CreatePartnerStatus$outboundSchema, programId: z.string(), tenantId: z.nullable(z.string()), links: z.nullable(z.array(z.lazy(() => CreatePartnerLink$outboundSchema))), diff --git a/src/models/operations/getcustomer.ts b/src/models/operations/getcustomer.ts index 49438536..bd2701e7 100644 --- a/src/models/operations/getcustomer.ts +++ b/src/models/operations/getcustomer.ts @@ -36,6 +36,10 @@ export type GetCustomerLink = { * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). */ shortLink: string; + /** + * The destination URL of the short link. + */ + url: string; /** * The ID of the program the short link is associated with. */ @@ -43,9 +47,21 @@ export type GetCustomerLink = { }; export type GetCustomerPartner = { + /** + * The partner's unique ID on Dub. + */ id: string; + /** + * The partner's full legal name. + */ name: string; + /** + * The partner's email address. Should be a unique value across Dub. + */ email: string | null; + /** + * The partner's avatar image. + */ image: string | null; }; @@ -94,6 +110,14 @@ export type GetCustomerResponseBody = { * Country of the customer. */ country?: string | null | undefined; + /** + * Total number of sales for the customer. + */ + sales?: number | null | undefined; + /** + * Total amount of sales for the customer. + */ + saleAmount?: number | null | undefined; /** * The date the customer was created. */ @@ -171,6 +195,7 @@ export const GetCustomerLink$inboundSchema: z.ZodType< domain: z.string(), key: z.string(), shortLink: z.string(), + url: z.string(), programId: z.nullable(z.string()), }); @@ -180,6 +205,7 @@ export type GetCustomerLink$Outbound = { domain: string; key: string; shortLink: string; + url: string; programId: string | null; }; @@ -193,6 +219,7 @@ export const GetCustomerLink$outboundSchema: z.ZodType< domain: z.string(), key: z.string(), shortLink: z.string(), + url: z.string(), programId: z.nullable(z.string()), }); @@ -396,6 +423,8 @@ export const GetCustomerResponseBody$inboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), link: z.nullable(z.lazy(() => GetCustomerLink$inboundSchema)).optional(), programId: z.nullable(z.string()).optional(), @@ -413,6 +442,8 @@ export type GetCustomerResponseBody$Outbound = { email?: string | null | undefined; avatar?: string | null | undefined; country?: string | null | undefined; + sales?: number | null | undefined; + saleAmount?: number | null | undefined; createdAt: string; link?: GetCustomerLink$Outbound | null | undefined; programId?: string | null | undefined; @@ -432,6 +463,8 @@ export const GetCustomerResponseBody$outboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), link: z.nullable(z.lazy(() => GetCustomerLink$outboundSchema)).optional(), programId: z.nullable(z.string()).optional(), diff --git a/src/models/operations/getcustomers.ts b/src/models/operations/getcustomers.ts index 730acb5c..ddf387be 100644 --- a/src/models/operations/getcustomers.ts +++ b/src/models/operations/getcustomers.ts @@ -8,6 +8,34 @@ import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +/** + * The field to sort the customers by. The default is `createdAt`. + */ +export const GetCustomersQueryParamSortBy = { + CreatedAt: "createdAt", + SaleAmount: "saleAmount", +} as const; +/** + * The field to sort the customers by. The default is `createdAt`. + */ +export type GetCustomersQueryParamSortBy = ClosedEnum< + typeof GetCustomersQueryParamSortBy +>; + +/** + * The sort order. The default is `desc`. + */ +export const GetCustomersQueryParamSortOrder = { + Asc: "asc", + Desc: "desc", +} as const; +/** + * The sort order. The default is `desc`. + */ +export type GetCustomersQueryParamSortOrder = ClosedEnum< + typeof GetCustomersQueryParamSortOrder +>; + export type GetCustomersRequest = { /** * A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. Takes precedence over `externalId`. @@ -21,10 +49,26 @@ export type GetCustomersRequest = { * A search query to filter customers by email, externalId, or name. If `email` or `externalId` is provided, this will be ignored. */ search?: string | undefined; + /** + * A filter on the list based on the customer's `country` field. + */ + country?: string | undefined; + /** + * A filter on the list based on the customer's `linkId` field (the referral link ID). + */ + linkId?: string | undefined; /** * Whether to include expanded fields on the customer (`link`, `partner`, `discount`). */ includeExpandedFields?: boolean | undefined; + /** + * The field to sort the customers by. The default is `createdAt`. + */ + sortBy?: GetCustomersQueryParamSortBy | undefined; + /** + * The sort order. The default is `desc`. + */ + sortOrder?: GetCustomersQueryParamSortOrder | undefined; /** * The page number for pagination. */ @@ -52,6 +96,10 @@ export type GetCustomersLink = { * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). */ shortLink: string; + /** + * The destination URL of the short link. + */ + url: string; /** * The ID of the program the short link is associated with. */ @@ -59,9 +107,21 @@ export type GetCustomersLink = { }; export type GetCustomersPartner = { + /** + * The partner's unique ID on Dub. + */ id: string; + /** + * The partner's full legal name. + */ name: string; + /** + * The partner's email address. Should be a unique value across Dub. + */ email: string | null; + /** + * The partner's avatar image. + */ image: string | null; }; @@ -107,6 +167,14 @@ export type GetCustomersResponseBody = { * Country of the customer. */ country?: string | null | undefined; + /** + * Total number of sales for the customer. + */ + sales?: number | null | undefined; + /** + * Total amount of sales for the customer. + */ + saleAmount?: number | null | undefined; /** * The date the customer was created. */ @@ -117,6 +185,48 @@ export type GetCustomersResponseBody = { discount?: Discount | null | undefined; }; +/** @internal */ +export const GetCustomersQueryParamSortBy$inboundSchema: z.ZodNativeEnum< + typeof GetCustomersQueryParamSortBy +> = z.nativeEnum(GetCustomersQueryParamSortBy); + +/** @internal */ +export const GetCustomersQueryParamSortBy$outboundSchema: z.ZodNativeEnum< + typeof GetCustomersQueryParamSortBy +> = GetCustomersQueryParamSortBy$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCustomersQueryParamSortBy$ { + /** @deprecated use `GetCustomersQueryParamSortBy$inboundSchema` instead. */ + export const inboundSchema = GetCustomersQueryParamSortBy$inboundSchema; + /** @deprecated use `GetCustomersQueryParamSortBy$outboundSchema` instead. */ + export const outboundSchema = GetCustomersQueryParamSortBy$outboundSchema; +} + +/** @internal */ +export const GetCustomersQueryParamSortOrder$inboundSchema: z.ZodNativeEnum< + typeof GetCustomersQueryParamSortOrder +> = z.nativeEnum(GetCustomersQueryParamSortOrder); + +/** @internal */ +export const GetCustomersQueryParamSortOrder$outboundSchema: z.ZodNativeEnum< + typeof GetCustomersQueryParamSortOrder +> = GetCustomersQueryParamSortOrder$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCustomersQueryParamSortOrder$ { + /** @deprecated use `GetCustomersQueryParamSortOrder$inboundSchema` instead. */ + export const inboundSchema = GetCustomersQueryParamSortOrder$inboundSchema; + /** @deprecated use `GetCustomersQueryParamSortOrder$outboundSchema` instead. */ + export const outboundSchema = GetCustomersQueryParamSortOrder$outboundSchema; +} + /** @internal */ export const GetCustomersRequest$inboundSchema: z.ZodType< GetCustomersRequest, @@ -126,7 +236,11 @@ export const GetCustomersRequest$inboundSchema: z.ZodType< email: z.string().optional(), externalId: z.string().optional(), search: z.string().optional(), + country: z.string().optional(), + linkId: z.string().optional(), includeExpandedFields: z.boolean().optional(), + sortBy: GetCustomersQueryParamSortBy$inboundSchema.default("createdAt"), + sortOrder: GetCustomersQueryParamSortOrder$inboundSchema.default("desc"), page: z.number().default(1), pageSize: z.number().default(100), }); @@ -136,7 +250,11 @@ export type GetCustomersRequest$Outbound = { email?: string | undefined; externalId?: string | undefined; search?: string | undefined; + country?: string | undefined; + linkId?: string | undefined; includeExpandedFields?: boolean | undefined; + sortBy: string; + sortOrder: string; page: number; pageSize: number; }; @@ -150,7 +268,11 @@ export const GetCustomersRequest$outboundSchema: z.ZodType< email: z.string().optional(), externalId: z.string().optional(), search: z.string().optional(), + country: z.string().optional(), + linkId: z.string().optional(), includeExpandedFields: z.boolean().optional(), + sortBy: GetCustomersQueryParamSortBy$outboundSchema.default("createdAt"), + sortOrder: GetCustomersQueryParamSortOrder$outboundSchema.default("desc"), page: z.number().default(1), pageSize: z.number().default(100), }); @@ -196,6 +318,7 @@ export const GetCustomersLink$inboundSchema: z.ZodType< domain: z.string(), key: z.string(), shortLink: z.string(), + url: z.string(), programId: z.nullable(z.string()), }); @@ -205,6 +328,7 @@ export type GetCustomersLink$Outbound = { domain: string; key: string; shortLink: string; + url: string; programId: string | null; }; @@ -218,6 +342,7 @@ export const GetCustomersLink$outboundSchema: z.ZodType< domain: z.string(), key: z.string(), shortLink: z.string(), + url: z.string(), programId: z.nullable(z.string()), }); @@ -419,6 +544,8 @@ export const GetCustomersResponseBody$inboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), link: z.nullable(z.lazy(() => GetCustomersLink$inboundSchema)).optional(), programId: z.nullable(z.string()).optional(), @@ -435,6 +562,8 @@ export type GetCustomersResponseBody$Outbound = { email?: string | null | undefined; avatar?: string | null | undefined; country?: string | null | undefined; + sales?: number | null | undefined; + saleAmount?: number | null | undefined; createdAt: string; link?: GetCustomersLink$Outbound | null | undefined; programId?: string | null | undefined; @@ -454,6 +583,8 @@ export const GetCustomersResponseBody$outboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), link: z.nullable(z.lazy(() => GetCustomersLink$outboundSchema)).optional(), programId: z.nullable(z.string()).optional(), diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index bcae755b..895c421a 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -26,6 +26,7 @@ export * from "./getlinkscount.js"; export * from "./getqrcode.js"; export * from "./gettags.js"; export * from "./getworkspace.js"; +export * from "./listcommissions.js"; export * from "./listdomains.js"; export * from "./listevents.js"; export * from "./listfolders.js"; @@ -34,11 +35,11 @@ export * from "./retrievelinks.js"; export * from "./retrievepartneranalytics.js"; export * from "./tracklead.js"; export * from "./tracksale.js"; +export * from "./updatecommission.js"; export * from "./updatecustomer.js"; export * from "./updatedomain.js"; export * from "./updatefolder.js"; export * from "./updatelink.js"; -export * from "./updatepartnersale.js"; export * from "./updatetag.js"; export * from "./updateworkspace.js"; export * from "./upsertlink.js"; diff --git a/src/models/operations/listcommissions.ts b/src/models/operations/listcommissions.ts new file mode 100644 index 00000000..0214a102 --- /dev/null +++ b/src/models/operations/listcommissions.ts @@ -0,0 +1,485 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export const Type = { + Click: "click", + Lead: "lead", + Sale: "sale", +} as const; +export type Type = ClosedEnum; + +/** + * Filter the list of commissions by their corresponding status. + */ +export const QueryParamStatus = { + Pending: "pending", + Processed: "processed", + Paid: "paid", + Refunded: "refunded", + Duplicate: "duplicate", + Fraud: "fraud", + Canceled: "canceled", +} as const; +/** + * Filter the list of commissions by their corresponding status. + */ +export type QueryParamStatus = ClosedEnum; + +/** + * The field to sort the list of commissions by. + */ +export const ListCommissionsQueryParamSortBy = { + CreatedAt: "createdAt", + Amount: "amount", +} as const; +/** + * The field to sort the list of commissions by. + */ +export type ListCommissionsQueryParamSortBy = ClosedEnum< + typeof ListCommissionsQueryParamSortBy +>; + +/** + * The sort order for the list of commissions. + */ +export const ListCommissionsQueryParamSortOrder = { + Asc: "asc", + Desc: "desc", +} as const; +/** + * The sort order for the list of commissions. + */ +export type ListCommissionsQueryParamSortOrder = ClosedEnum< + typeof ListCommissionsQueryParamSortOrder +>; + +/** + * The interval to retrieve commissions for. + */ +export const ListCommissionsQueryParamInterval = { + TwentyFourh: "24h", + Sevend: "7d", + Thirtyd: "30d", + Ninetyd: "90d", + Oney: "1y", + Mtd: "mtd", + Qtd: "qtd", + Ytd: "ytd", + All: "all", +} as const; +/** + * The interval to retrieve commissions for. + */ +export type ListCommissionsQueryParamInterval = ClosedEnum< + typeof ListCommissionsQueryParamInterval +>; + +export type ListCommissionsRequest = { + type?: Type | undefined; + /** + * Filter the list of commissions by the associated customer. + */ + customerId?: string | undefined; + /** + * Filter the list of commissions by the associated payout. + */ + payoutId?: string | undefined; + /** + * Filter the list of commissions by the associated partner. + */ + partnerId?: string | undefined; + /** + * Filter the list of commissions by the associated invoice. Since invoiceId is unique on a per-program basis, this will only return one commission per invoice. + */ + invoiceId?: string | undefined; + /** + * Filter the list of commissions by their corresponding status. + */ + status?: QueryParamStatus | undefined; + /** + * The field to sort the list of commissions by. + */ + sortBy?: ListCommissionsQueryParamSortBy | undefined; + /** + * The sort order for the list of commissions. + */ + sortOrder?: ListCommissionsQueryParamSortOrder | undefined; + /** + * The interval to retrieve commissions for. + */ + interval?: ListCommissionsQueryParamInterval | undefined; + /** + * The start date of the date range to filter the commissions by. + */ + start?: string | undefined; + /** + * The end date of the date range to filter the commissions by. + */ + end?: string | undefined; + /** + * The page number for pagination. + */ + page?: number | undefined; + /** + * The number of items per page. + */ + pageSize?: number | undefined; +}; + +export const ListCommissionsType = { + Click: "click", + Lead: "lead", + Sale: "sale", +} as const; +export type ListCommissionsType = ClosedEnum; + +export const ListCommissionsStatus = { + Pending: "pending", + Processed: "processed", + Paid: "paid", + Refunded: "refunded", + Duplicate: "duplicate", + Fraud: "fraud", + Canceled: "canceled", +} as const; +export type ListCommissionsStatus = ClosedEnum; + +export type ListCommissionsResponseBody = { + /** + * The commission's unique ID on Dub. + */ + id: string; + type?: ListCommissionsType | undefined; + amount: number; + earnings: number; + currency: string; + status: ListCommissionsStatus; + invoiceId?: string | null | undefined; + createdAt: string; + updatedAt: string; +}; + +/** @internal */ +export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum( + Type, +); + +/** @internal */ +export const Type$outboundSchema: z.ZodNativeEnum = + Type$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Type$ { + /** @deprecated use `Type$inboundSchema` instead. */ + export const inboundSchema = Type$inboundSchema; + /** @deprecated use `Type$outboundSchema` instead. */ + export const outboundSchema = Type$outboundSchema; +} + +/** @internal */ +export const QueryParamStatus$inboundSchema: z.ZodNativeEnum< + typeof QueryParamStatus +> = z.nativeEnum(QueryParamStatus); + +/** @internal */ +export const QueryParamStatus$outboundSchema: z.ZodNativeEnum< + typeof QueryParamStatus +> = QueryParamStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace QueryParamStatus$ { + /** @deprecated use `QueryParamStatus$inboundSchema` instead. */ + export const inboundSchema = QueryParamStatus$inboundSchema; + /** @deprecated use `QueryParamStatus$outboundSchema` instead. */ + export const outboundSchema = QueryParamStatus$outboundSchema; +} + +/** @internal */ +export const ListCommissionsQueryParamSortBy$inboundSchema: z.ZodNativeEnum< + typeof ListCommissionsQueryParamSortBy +> = z.nativeEnum(ListCommissionsQueryParamSortBy); + +/** @internal */ +export const ListCommissionsQueryParamSortBy$outboundSchema: z.ZodNativeEnum< + typeof ListCommissionsQueryParamSortBy +> = ListCommissionsQueryParamSortBy$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCommissionsQueryParamSortBy$ { + /** @deprecated use `ListCommissionsQueryParamSortBy$inboundSchema` instead. */ + export const inboundSchema = ListCommissionsQueryParamSortBy$inboundSchema; + /** @deprecated use `ListCommissionsQueryParamSortBy$outboundSchema` instead. */ + export const outboundSchema = ListCommissionsQueryParamSortBy$outboundSchema; +} + +/** @internal */ +export const ListCommissionsQueryParamSortOrder$inboundSchema: z.ZodNativeEnum< + typeof ListCommissionsQueryParamSortOrder +> = z.nativeEnum(ListCommissionsQueryParamSortOrder); + +/** @internal */ +export const ListCommissionsQueryParamSortOrder$outboundSchema: z.ZodNativeEnum< + typeof ListCommissionsQueryParamSortOrder +> = ListCommissionsQueryParamSortOrder$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCommissionsQueryParamSortOrder$ { + /** @deprecated use `ListCommissionsQueryParamSortOrder$inboundSchema` instead. */ + export const inboundSchema = ListCommissionsQueryParamSortOrder$inboundSchema; + /** @deprecated use `ListCommissionsQueryParamSortOrder$outboundSchema` instead. */ + export const outboundSchema = + ListCommissionsQueryParamSortOrder$outboundSchema; +} + +/** @internal */ +export const ListCommissionsQueryParamInterval$inboundSchema: z.ZodNativeEnum< + typeof ListCommissionsQueryParamInterval +> = z.nativeEnum(ListCommissionsQueryParamInterval); + +/** @internal */ +export const ListCommissionsQueryParamInterval$outboundSchema: z.ZodNativeEnum< + typeof ListCommissionsQueryParamInterval +> = ListCommissionsQueryParamInterval$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCommissionsQueryParamInterval$ { + /** @deprecated use `ListCommissionsQueryParamInterval$inboundSchema` instead. */ + export const inboundSchema = ListCommissionsQueryParamInterval$inboundSchema; + /** @deprecated use `ListCommissionsQueryParamInterval$outboundSchema` instead. */ + export const outboundSchema = + ListCommissionsQueryParamInterval$outboundSchema; +} + +/** @internal */ +export const ListCommissionsRequest$inboundSchema: z.ZodType< + ListCommissionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + type: Type$inboundSchema.optional(), + customerId: z.string().optional(), + payoutId: z.string().optional(), + partnerId: z.string().optional(), + invoiceId: z.string().optional(), + status: QueryParamStatus$inboundSchema.optional(), + sortBy: ListCommissionsQueryParamSortBy$inboundSchema.default("createdAt"), + sortOrder: ListCommissionsQueryParamSortOrder$inboundSchema.default("desc"), + interval: ListCommissionsQueryParamInterval$inboundSchema.default("all"), + start: z.string().optional(), + end: z.string().optional(), + page: z.number().default(1), + pageSize: z.number().default(100), +}); + +/** @internal */ +export type ListCommissionsRequest$Outbound = { + type?: string | undefined; + customerId?: string | undefined; + payoutId?: string | undefined; + partnerId?: string | undefined; + invoiceId?: string | undefined; + status?: string | undefined; + sortBy: string; + sortOrder: string; + interval: string; + start?: string | undefined; + end?: string | undefined; + page: number; + pageSize: number; +}; + +/** @internal */ +export const ListCommissionsRequest$outboundSchema: z.ZodType< + ListCommissionsRequest$Outbound, + z.ZodTypeDef, + ListCommissionsRequest +> = z.object({ + type: Type$outboundSchema.optional(), + customerId: z.string().optional(), + payoutId: z.string().optional(), + partnerId: z.string().optional(), + invoiceId: z.string().optional(), + status: QueryParamStatus$outboundSchema.optional(), + sortBy: ListCommissionsQueryParamSortBy$outboundSchema.default("createdAt"), + sortOrder: ListCommissionsQueryParamSortOrder$outboundSchema.default("desc"), + interval: ListCommissionsQueryParamInterval$outboundSchema.default("all"), + start: z.string().optional(), + end: z.string().optional(), + page: z.number().default(1), + pageSize: z.number().default(100), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCommissionsRequest$ { + /** @deprecated use `ListCommissionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListCommissionsRequest$inboundSchema; + /** @deprecated use `ListCommissionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListCommissionsRequest$outboundSchema; + /** @deprecated use `ListCommissionsRequest$Outbound` instead. */ + export type Outbound = ListCommissionsRequest$Outbound; +} + +export function listCommissionsRequestToJSON( + listCommissionsRequest: ListCommissionsRequest, +): string { + return JSON.stringify( + ListCommissionsRequest$outboundSchema.parse(listCommissionsRequest), + ); +} + +export function listCommissionsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListCommissionsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListCommissionsRequest' from JSON`, + ); +} + +/** @internal */ +export const ListCommissionsType$inboundSchema: z.ZodNativeEnum< + typeof ListCommissionsType +> = z.nativeEnum(ListCommissionsType); + +/** @internal */ +export const ListCommissionsType$outboundSchema: z.ZodNativeEnum< + typeof ListCommissionsType +> = ListCommissionsType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCommissionsType$ { + /** @deprecated use `ListCommissionsType$inboundSchema` instead. */ + export const inboundSchema = ListCommissionsType$inboundSchema; + /** @deprecated use `ListCommissionsType$outboundSchema` instead. */ + export const outboundSchema = ListCommissionsType$outboundSchema; +} + +/** @internal */ +export const ListCommissionsStatus$inboundSchema: z.ZodNativeEnum< + typeof ListCommissionsStatus +> = z.nativeEnum(ListCommissionsStatus); + +/** @internal */ +export const ListCommissionsStatus$outboundSchema: z.ZodNativeEnum< + typeof ListCommissionsStatus +> = ListCommissionsStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCommissionsStatus$ { + /** @deprecated use `ListCommissionsStatus$inboundSchema` instead. */ + export const inboundSchema = ListCommissionsStatus$inboundSchema; + /** @deprecated use `ListCommissionsStatus$outboundSchema` instead. */ + export const outboundSchema = ListCommissionsStatus$outboundSchema; +} + +/** @internal */ +export const ListCommissionsResponseBody$inboundSchema: z.ZodType< + ListCommissionsResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), + type: ListCommissionsType$inboundSchema.optional(), + amount: z.number(), + earnings: z.number(), + currency: z.string(), + status: ListCommissionsStatus$inboundSchema, + invoiceId: z.nullable(z.string()).optional(), + createdAt: z.string(), + updatedAt: z.string(), +}); + +/** @internal */ +export type ListCommissionsResponseBody$Outbound = { + id: string; + type?: string | undefined; + amount: number; + earnings: number; + currency: string; + status: string; + invoiceId?: string | null | undefined; + createdAt: string; + updatedAt: string; +}; + +/** @internal */ +export const ListCommissionsResponseBody$outboundSchema: z.ZodType< + ListCommissionsResponseBody$Outbound, + z.ZodTypeDef, + ListCommissionsResponseBody +> = z.object({ + id: z.string(), + type: ListCommissionsType$outboundSchema.optional(), + amount: z.number(), + earnings: z.number(), + currency: z.string(), + status: ListCommissionsStatus$outboundSchema, + invoiceId: z.nullable(z.string()).optional(), + createdAt: z.string(), + updatedAt: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCommissionsResponseBody$ { + /** @deprecated use `ListCommissionsResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListCommissionsResponseBody$inboundSchema; + /** @deprecated use `ListCommissionsResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListCommissionsResponseBody$outboundSchema; + /** @deprecated use `ListCommissionsResponseBody$Outbound` instead. */ + export type Outbound = ListCommissionsResponseBody$Outbound; +} + +export function listCommissionsResponseBodyToJSON( + listCommissionsResponseBody: ListCommissionsResponseBody, +): string { + return JSON.stringify( + ListCommissionsResponseBody$outboundSchema.parse( + listCommissionsResponseBody, + ), + ); +} + +export function listCommissionsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListCommissionsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListCommissionsResponseBody' from JSON`, + ); +} diff --git a/src/models/operations/updatecommission.ts b/src/models/operations/updatecommission.ts new file mode 100644 index 00000000..6fcb2891 --- /dev/null +++ b/src/models/operations/updatecommission.ts @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +/** + * Useful for marking a commission as refunded, duplicate, canceled, or fraudulent. Takes precedence over `amount` and `modifyAmount`. When a commission is marked as refunded, duplicate, canceled, or fraudulent, it will be omitted from the payout, and the payout amount will be recalculated accordingly. Paid commissions cannot be updated. + */ +export const Status = { + Refunded: "refunded", + Duplicate: "duplicate", + Canceled: "canceled", + Fraud: "fraud", +} as const; +/** + * Useful for marking a commission as refunded, duplicate, canceled, or fraudulent. Takes precedence over `amount` and `modifyAmount`. When a commission is marked as refunded, duplicate, canceled, or fraudulent, it will be omitted from the payout, and the payout amount will be recalculated accordingly. Paid commissions cannot be updated. + */ +export type Status = ClosedEnum; + +export type UpdateCommissionRequestBody = { + /** + * The new absolute amount for the sale. Paid commissions cannot be updated. + */ + amount?: number | undefined; + /** + * Modify the current sale amount: use positive values to increase the amount, negative values to decrease it. Takes precedence over `amount`. Paid commissions cannot be updated. + */ + modifyAmount?: number | undefined; + /** + * The currency of the sale amount to update. Accepts ISO 4217 currency codes. + */ + currency?: string | undefined; + /** + * Useful for marking a commission as refunded, duplicate, canceled, or fraudulent. Takes precedence over `amount` and `modifyAmount`. When a commission is marked as refunded, duplicate, canceled, or fraudulent, it will be omitted from the payout, and the payout amount will be recalculated accordingly. Paid commissions cannot be updated. + */ + status?: Status | undefined; +}; + +export type UpdateCommissionRequest = { + /** + * The commission's unique ID on Dub. + */ + id: string; + requestBody?: UpdateCommissionRequestBody | undefined; +}; + +export const UpdateCommissionType = { + Click: "click", + Lead: "lead", + Sale: "sale", +} as const; +export type UpdateCommissionType = ClosedEnum; + +export const UpdateCommissionStatus = { + Pending: "pending", + Processed: "processed", + Paid: "paid", + Refunded: "refunded", + Duplicate: "duplicate", + Fraud: "fraud", + Canceled: "canceled", +} as const; +export type UpdateCommissionStatus = ClosedEnum; + +/** + * The updated commission. + */ +export type UpdateCommissionResponseBody = { + /** + * The commission's unique ID on Dub. + */ + id: string; + type?: UpdateCommissionType | undefined; + amount: number; + earnings: number; + currency: string; + status: UpdateCommissionStatus; + invoiceId?: string | null | undefined; + createdAt: string; + updatedAt: string; +}; + +/** @internal */ +export const Status$inboundSchema: z.ZodNativeEnum = z + .nativeEnum(Status); + +/** @internal */ +export const Status$outboundSchema: z.ZodNativeEnum = + Status$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Status$ { + /** @deprecated use `Status$inboundSchema` instead. */ + export const inboundSchema = Status$inboundSchema; + /** @deprecated use `Status$outboundSchema` instead. */ + export const outboundSchema = Status$outboundSchema; +} + +/** @internal */ +export const UpdateCommissionRequestBody$inboundSchema: z.ZodType< + UpdateCommissionRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + amount: z.number().optional(), + modifyAmount: z.number().optional(), + currency: z.string().default("usd"), + status: Status$inboundSchema.optional(), +}); + +/** @internal */ +export type UpdateCommissionRequestBody$Outbound = { + amount?: number | undefined; + modifyAmount?: number | undefined; + currency: string; + status?: string | undefined; +}; + +/** @internal */ +export const UpdateCommissionRequestBody$outboundSchema: z.ZodType< + UpdateCommissionRequestBody$Outbound, + z.ZodTypeDef, + UpdateCommissionRequestBody +> = z.object({ + amount: z.number().optional(), + modifyAmount: z.number().optional(), + currency: z.string().default("usd"), + status: Status$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCommissionRequestBody$ { + /** @deprecated use `UpdateCommissionRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateCommissionRequestBody$inboundSchema; + /** @deprecated use `UpdateCommissionRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateCommissionRequestBody$outboundSchema; + /** @deprecated use `UpdateCommissionRequestBody$Outbound` instead. */ + export type Outbound = UpdateCommissionRequestBody$Outbound; +} + +export function updateCommissionRequestBodyToJSON( + updateCommissionRequestBody: UpdateCommissionRequestBody, +): string { + return JSON.stringify( + UpdateCommissionRequestBody$outboundSchema.parse( + updateCommissionRequestBody, + ), + ); +} + +export function updateCommissionRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateCommissionRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateCommissionRequestBody' from JSON`, + ); +} + +/** @internal */ +export const UpdateCommissionRequest$inboundSchema: z.ZodType< + UpdateCommissionRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), + RequestBody: z.lazy(() => UpdateCommissionRequestBody$inboundSchema) + .optional(), +}).transform((v) => { + return remap$(v, { + "RequestBody": "requestBody", + }); +}); + +/** @internal */ +export type UpdateCommissionRequest$Outbound = { + id: string; + RequestBody?: UpdateCommissionRequestBody$Outbound | undefined; +}; + +/** @internal */ +export const UpdateCommissionRequest$outboundSchema: z.ZodType< + UpdateCommissionRequest$Outbound, + z.ZodTypeDef, + UpdateCommissionRequest +> = z.object({ + id: z.string(), + requestBody: z.lazy(() => UpdateCommissionRequestBody$outboundSchema) + .optional(), +}).transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCommissionRequest$ { + /** @deprecated use `UpdateCommissionRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateCommissionRequest$inboundSchema; + /** @deprecated use `UpdateCommissionRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateCommissionRequest$outboundSchema; + /** @deprecated use `UpdateCommissionRequest$Outbound` instead. */ + export type Outbound = UpdateCommissionRequest$Outbound; +} + +export function updateCommissionRequestToJSON( + updateCommissionRequest: UpdateCommissionRequest, +): string { + return JSON.stringify( + UpdateCommissionRequest$outboundSchema.parse(updateCommissionRequest), + ); +} + +export function updateCommissionRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateCommissionRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateCommissionRequest' from JSON`, + ); +} + +/** @internal */ +export const UpdateCommissionType$inboundSchema: z.ZodNativeEnum< + typeof UpdateCommissionType +> = z.nativeEnum(UpdateCommissionType); + +/** @internal */ +export const UpdateCommissionType$outboundSchema: z.ZodNativeEnum< + typeof UpdateCommissionType +> = UpdateCommissionType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCommissionType$ { + /** @deprecated use `UpdateCommissionType$inboundSchema` instead. */ + export const inboundSchema = UpdateCommissionType$inboundSchema; + /** @deprecated use `UpdateCommissionType$outboundSchema` instead. */ + export const outboundSchema = UpdateCommissionType$outboundSchema; +} + +/** @internal */ +export const UpdateCommissionStatus$inboundSchema: z.ZodNativeEnum< + typeof UpdateCommissionStatus +> = z.nativeEnum(UpdateCommissionStatus); + +/** @internal */ +export const UpdateCommissionStatus$outboundSchema: z.ZodNativeEnum< + typeof UpdateCommissionStatus +> = UpdateCommissionStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCommissionStatus$ { + /** @deprecated use `UpdateCommissionStatus$inboundSchema` instead. */ + export const inboundSchema = UpdateCommissionStatus$inboundSchema; + /** @deprecated use `UpdateCommissionStatus$outboundSchema` instead. */ + export const outboundSchema = UpdateCommissionStatus$outboundSchema; +} + +/** @internal */ +export const UpdateCommissionResponseBody$inboundSchema: z.ZodType< + UpdateCommissionResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), + type: UpdateCommissionType$inboundSchema.optional(), + amount: z.number(), + earnings: z.number(), + currency: z.string(), + status: UpdateCommissionStatus$inboundSchema, + invoiceId: z.nullable(z.string()).optional(), + createdAt: z.string(), + updatedAt: z.string(), +}); + +/** @internal */ +export type UpdateCommissionResponseBody$Outbound = { + id: string; + type?: string | undefined; + amount: number; + earnings: number; + currency: string; + status: string; + invoiceId?: string | null | undefined; + createdAt: string; + updatedAt: string; +}; + +/** @internal */ +export const UpdateCommissionResponseBody$outboundSchema: z.ZodType< + UpdateCommissionResponseBody$Outbound, + z.ZodTypeDef, + UpdateCommissionResponseBody +> = z.object({ + id: z.string(), + type: UpdateCommissionType$outboundSchema.optional(), + amount: z.number(), + earnings: z.number(), + currency: z.string(), + status: UpdateCommissionStatus$outboundSchema, + invoiceId: z.nullable(z.string()).optional(), + createdAt: z.string(), + updatedAt: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCommissionResponseBody$ { + /** @deprecated use `UpdateCommissionResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdateCommissionResponseBody$inboundSchema; + /** @deprecated use `UpdateCommissionResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdateCommissionResponseBody$outboundSchema; + /** @deprecated use `UpdateCommissionResponseBody$Outbound` instead. */ + export type Outbound = UpdateCommissionResponseBody$Outbound; +} + +export function updateCommissionResponseBodyToJSON( + updateCommissionResponseBody: UpdateCommissionResponseBody, +): string { + return JSON.stringify( + UpdateCommissionResponseBody$outboundSchema.parse( + updateCommissionResponseBody, + ), + ); +} + +export function updateCommissionResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateCommissionResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateCommissionResponseBody' from JSON`, + ); +} diff --git a/src/models/operations/updatecustomer.ts b/src/models/operations/updatecustomer.ts index a273804e..c9fd8afe 100644 --- a/src/models/operations/updatecustomer.ts +++ b/src/models/operations/updatecustomer.ts @@ -57,6 +57,10 @@ export type UpdateCustomerLink = { * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). */ shortLink: string; + /** + * The destination URL of the short link. + */ + url: string; /** * The ID of the program the short link is associated with. */ @@ -64,9 +68,21 @@ export type UpdateCustomerLink = { }; export type UpdateCustomerPartner = { + /** + * The partner's unique ID on Dub. + */ id: string; + /** + * The partner's full legal name. + */ name: string; + /** + * The partner's email address. Should be a unique value across Dub. + */ email: string | null; + /** + * The partner's avatar image. + */ image: string | null; }; @@ -115,6 +131,14 @@ export type UpdateCustomerResponseBody = { * Country of the customer. */ country?: string | null | undefined; + /** + * Total number of sales for the customer. + */ + sales?: number | null | undefined; + /** + * Total amount of sales for the customer. + */ + saleAmount?: number | null | undefined; /** * The date the customer was created. */ @@ -267,6 +291,7 @@ export const UpdateCustomerLink$inboundSchema: z.ZodType< domain: z.string(), key: z.string(), shortLink: z.string(), + url: z.string(), programId: z.nullable(z.string()), }); @@ -276,6 +301,7 @@ export type UpdateCustomerLink$Outbound = { domain: string; key: string; shortLink: string; + url: string; programId: string | null; }; @@ -289,6 +315,7 @@ export const UpdateCustomerLink$outboundSchema: z.ZodType< domain: z.string(), key: z.string(), shortLink: z.string(), + url: z.string(), programId: z.nullable(z.string()), }); @@ -494,6 +521,8 @@ export const UpdateCustomerResponseBody$inboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), link: z.nullable(z.lazy(() => UpdateCustomerLink$inboundSchema)).optional(), programId: z.nullable(z.string()).optional(), @@ -511,6 +540,8 @@ export type UpdateCustomerResponseBody$Outbound = { email?: string | null | undefined; avatar?: string | null | undefined; country?: string | null | undefined; + sales?: number | null | undefined; + saleAmount?: number | null | undefined; createdAt: string; link?: UpdateCustomerLink$Outbound | null | undefined; programId?: string | null | undefined; @@ -530,6 +561,8 @@ export const UpdateCustomerResponseBody$outboundSchema: z.ZodType< email: z.nullable(z.string()).optional(), avatar: z.nullable(z.string()).optional(), country: z.nullable(z.string()).optional(), + sales: z.nullable(z.number()).optional(), + saleAmount: z.nullable(z.number()).optional(), createdAt: z.string(), link: z.nullable(z.lazy(() => UpdateCustomerLink$outboundSchema)).optional(), programId: z.nullable(z.string()).optional(), diff --git a/src/models/operations/updatepartnersale.ts b/src/models/operations/updatepartnersale.ts deleted file mode 100644 index 71f7a365..00000000 --- a/src/models/operations/updatepartnersale.ts +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type UpdatePartnerSaleRequestBody = { - programId: string; - invoiceId: string; - /** - * The new absolute amount for the sale. - */ - amount?: number | undefined; - /** - * Modify the current sale amount: use positive values to increase the amount, negative values to decrease it. - */ - modifyAmount?: number | undefined; - /** - * The currency of the sale amount to update. Accepts ISO 4217 currency codes. - */ - currency?: string | undefined; -}; - -export const Type = { - Click: "click", - Lead: "lead", - Sale: "sale", -} as const; -export type Type = ClosedEnum; - -export const UpdatePartnerSaleStatus = { - Pending: "pending", - Processed: "processed", - Paid: "paid", - Refunded: "refunded", - Duplicate: "duplicate", - Fraud: "fraud", - Canceled: "canceled", -} as const; -export type UpdatePartnerSaleStatus = ClosedEnum< - typeof UpdatePartnerSaleStatus ->; - -/** - * The updated sale. - */ -export type UpdatePartnerSaleResponseBody = { - id: string; - type?: Type | undefined; - amount: number; - earnings: number; - currency: string; - status: UpdatePartnerSaleStatus; - invoiceId?: string | null | undefined; - createdAt: string; - updatedAt: string; -}; - -/** @internal */ -export const UpdatePartnerSaleRequestBody$inboundSchema: z.ZodType< - UpdatePartnerSaleRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - programId: z.string(), - invoiceId: z.string(), - amount: z.number().optional(), - modifyAmount: z.number().optional(), - currency: z.string().default("usd"), -}); - -/** @internal */ -export type UpdatePartnerSaleRequestBody$Outbound = { - programId: string; - invoiceId: string; - amount?: number | undefined; - modifyAmount?: number | undefined; - currency: string; -}; - -/** @internal */ -export const UpdatePartnerSaleRequestBody$outboundSchema: z.ZodType< - UpdatePartnerSaleRequestBody$Outbound, - z.ZodTypeDef, - UpdatePartnerSaleRequestBody -> = z.object({ - programId: z.string(), - invoiceId: z.string(), - amount: z.number().optional(), - modifyAmount: z.number().optional(), - currency: z.string().default("usd"), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdatePartnerSaleRequestBody$ { - /** @deprecated use `UpdatePartnerSaleRequestBody$inboundSchema` instead. */ - export const inboundSchema = UpdatePartnerSaleRequestBody$inboundSchema; - /** @deprecated use `UpdatePartnerSaleRequestBody$outboundSchema` instead. */ - export const outboundSchema = UpdatePartnerSaleRequestBody$outboundSchema; - /** @deprecated use `UpdatePartnerSaleRequestBody$Outbound` instead. */ - export type Outbound = UpdatePartnerSaleRequestBody$Outbound; -} - -export function updatePartnerSaleRequestBodyToJSON( - updatePartnerSaleRequestBody: UpdatePartnerSaleRequestBody, -): string { - return JSON.stringify( - UpdatePartnerSaleRequestBody$outboundSchema.parse( - updatePartnerSaleRequestBody, - ), - ); -} - -export function updatePartnerSaleRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdatePartnerSaleRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdatePartnerSaleRequestBody' from JSON`, - ); -} - -/** @internal */ -export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum( - Type, -); - -/** @internal */ -export const Type$outboundSchema: z.ZodNativeEnum = - Type$inboundSchema; - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Type$ { - /** @deprecated use `Type$inboundSchema` instead. */ - export const inboundSchema = Type$inboundSchema; - /** @deprecated use `Type$outboundSchema` instead. */ - export const outboundSchema = Type$outboundSchema; -} - -/** @internal */ -export const UpdatePartnerSaleStatus$inboundSchema: z.ZodNativeEnum< - typeof UpdatePartnerSaleStatus -> = z.nativeEnum(UpdatePartnerSaleStatus); - -/** @internal */ -export const UpdatePartnerSaleStatus$outboundSchema: z.ZodNativeEnum< - typeof UpdatePartnerSaleStatus -> = UpdatePartnerSaleStatus$inboundSchema; - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdatePartnerSaleStatus$ { - /** @deprecated use `UpdatePartnerSaleStatus$inboundSchema` instead. */ - export const inboundSchema = UpdatePartnerSaleStatus$inboundSchema; - /** @deprecated use `UpdatePartnerSaleStatus$outboundSchema` instead. */ - export const outboundSchema = UpdatePartnerSaleStatus$outboundSchema; -} - -/** @internal */ -export const UpdatePartnerSaleResponseBody$inboundSchema: z.ZodType< - UpdatePartnerSaleResponseBody, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), - type: Type$inboundSchema.optional(), - amount: z.number(), - earnings: z.number(), - currency: z.string(), - status: UpdatePartnerSaleStatus$inboundSchema, - invoiceId: z.nullable(z.string()).optional(), - createdAt: z.string(), - updatedAt: z.string(), -}); - -/** @internal */ -export type UpdatePartnerSaleResponseBody$Outbound = { - id: string; - type?: string | undefined; - amount: number; - earnings: number; - currency: string; - status: string; - invoiceId?: string | null | undefined; - createdAt: string; - updatedAt: string; -}; - -/** @internal */ -export const UpdatePartnerSaleResponseBody$outboundSchema: z.ZodType< - UpdatePartnerSaleResponseBody$Outbound, - z.ZodTypeDef, - UpdatePartnerSaleResponseBody -> = z.object({ - id: z.string(), - type: Type$outboundSchema.optional(), - amount: z.number(), - earnings: z.number(), - currency: z.string(), - status: UpdatePartnerSaleStatus$outboundSchema, - invoiceId: z.nullable(z.string()).optional(), - createdAt: z.string(), - updatedAt: z.string(), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdatePartnerSaleResponseBody$ { - /** @deprecated use `UpdatePartnerSaleResponseBody$inboundSchema` instead. */ - export const inboundSchema = UpdatePartnerSaleResponseBody$inboundSchema; - /** @deprecated use `UpdatePartnerSaleResponseBody$outboundSchema` instead. */ - export const outboundSchema = UpdatePartnerSaleResponseBody$outboundSchema; - /** @deprecated use `UpdatePartnerSaleResponseBody$Outbound` instead. */ - export type Outbound = UpdatePartnerSaleResponseBody$Outbound; -} - -export function updatePartnerSaleResponseBodyToJSON( - updatePartnerSaleResponseBody: UpdatePartnerSaleResponseBody, -): string { - return JSON.stringify( - UpdatePartnerSaleResponseBody$outboundSchema.parse( - updatePartnerSaleResponseBody, - ), - ); -} - -export function updatePartnerSaleResponseBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdatePartnerSaleResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdatePartnerSaleResponseBody' from JSON`, - ); -} diff --git a/src/sdk/commissions.ts b/src/sdk/commissions.ts new file mode 100644 index 00000000..277b629a --- /dev/null +++ b/src/sdk/commissions.ts @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { commissionsList } from "../funcs/commissionsList.js"; +import { commissionsUpdate } from "../funcs/commissionsUpdate.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Commissions extends ClientSDK { + /** + * Get commissions for a program. + * + * @remarks + * Retrieve a list of commissions for a program. + */ + async list( + request?: operations.ListCommissionsRequest | undefined, + options?: RequestOptions, + ): Promise> { + return unwrapAsync(commissionsList( + this, + request, + options, + )); + } + + /** + * Update a commission. + * + * @remarks + * Update an existing commission amount. This is useful for handling refunds (partial or full) or fraudulent sales. + */ + async update( + request: operations.UpdateCommissionRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(commissionsUpdate( + this, + request, + options, + )); + } +} diff --git a/src/sdk/partners.ts b/src/sdk/partners.ts index 7a21d005..111c0bed 100644 --- a/src/sdk/partners.ts +++ b/src/sdk/partners.ts @@ -6,7 +6,6 @@ import { partnersAnalytics } from "../funcs/partnersAnalytics.js"; import { partnersCreate } from "../funcs/partnersCreate.js"; import { partnersCreateLink } from "../funcs/partnersCreateLink.js"; import { partnersRetrieveLinks } from "../funcs/partnersRetrieveLinks.js"; -import { partnersUpdateSale } from "../funcs/partnersUpdateSale.js"; import { partnersUpsertLink } from "../funcs/partnersUpsertLink.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; @@ -98,21 +97,4 @@ export class Partners extends ClientSDK { options, )); } - - /** - * Update a sale for a partner. - * - * @remarks - * Update an existing sale amount. This is useful for handling refunds (partial or full) or fraudulent sales. - */ - async updateSale( - request?: operations.UpdatePartnerSaleRequestBody | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(partnersUpdateSale( - this, - request, - options, - )); - } } diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 6a4c4327..49b5870e 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -4,6 +4,7 @@ import { ClientSDK } from "../lib/sdks.js"; import { Analytics } from "./analytics.js"; +import { Commissions } from "./commissions.js"; import { Customers } from "./customers.js"; import { Domains } from "./domains.js"; import { EmbedTokens } from "./embedtokens.js"; @@ -62,6 +63,11 @@ export class Dub extends ClientSDK { return (this._partners ??= new Partners(this._options)); } + private _commissions?: Commissions; + get commissions(): Commissions { + return (this._commissions ??= new Commissions(this._options)); + } + private _workspaces?: Workspaces; get workspaces(): Workspaces { return (this._workspaces ??= new Workspaces(this._options));