dub 0.20.2 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/.speakeasy/gen.lock +30 -5
  2. package/.speakeasy/gen.yaml +2 -1
  3. package/README.md +45 -20
  4. package/docs/sdks/analytics/README.md +40 -20
  5. package/docs/sdks/links/README.md +26 -14
  6. package/docs/sdks/qrcodes/README.md +4 -2
  7. package/docs/sdks/tags/README.md +8 -4
  8. package/docs/sdks/workspaces/README.md +12 -6
  9. package/hooks/auth.d.ts +3 -0
  10. package/hooks/auth.d.ts.map +1 -0
  11. package/hooks/auth.js +22 -0
  12. package/hooks/auth.js.map +1 -0
  13. package/hooks/base-url.d.ts +3 -0
  14. package/hooks/base-url.d.ts.map +1 -0
  15. package/hooks/base-url.js +24 -0
  16. package/hooks/base-url.js.map +1 -0
  17. package/hooks/hooks.d.ts.map +1 -1
  18. package/hooks/hooks.js +2 -0
  19. package/hooks/hooks.js.map +1 -1
  20. package/hooks/registration.d.ts +3 -0
  21. package/hooks/registration.d.ts.map +1 -0
  22. package/hooks/registration.js +19 -0
  23. package/hooks/registration.js.map +1 -0
  24. package/lib/config.d.ts +3 -3
  25. package/lib/config.js +3 -3
  26. package/models/operations/bulkcreatelinks.d.ts +14 -0
  27. package/models/operations/bulkcreatelinks.d.ts.map +1 -1
  28. package/models/operations/bulkcreatelinks.js +23 -1
  29. package/models/operations/bulkcreatelinks.js.map +1 -1
  30. package/models/operations/createlink.d.ts +14 -0
  31. package/models/operations/createlink.d.ts.map +1 -1
  32. package/models/operations/createlink.js +23 -1
  33. package/models/operations/createlink.js.map +1 -1
  34. package/models/operations/createtag.d.ts +14 -0
  35. package/models/operations/createtag.d.ts.map +1 -1
  36. package/models/operations/createtag.js +23 -1
  37. package/models/operations/createtag.js.map +1 -1
  38. package/models/operations/createworkspace.d.ts +14 -0
  39. package/models/operations/createworkspace.d.ts.map +1 -1
  40. package/models/operations/createworkspace.js +23 -1
  41. package/models/operations/createworkspace.js.map +1 -1
  42. package/models/operations/deletelink.d.ts +14 -0
  43. package/models/operations/deletelink.d.ts.map +1 -1
  44. package/models/operations/deletelink.js +23 -1
  45. package/models/operations/deletelink.js.map +1 -1
  46. package/models/operations/editlink.d.ts +14 -0
  47. package/models/operations/editlink.d.ts.map +1 -1
  48. package/models/operations/editlink.js +23 -1
  49. package/models/operations/editlink.js.map +1 -1
  50. package/models/operations/getbrowseranalytics.d.ts +14 -0
  51. package/models/operations/getbrowseranalytics.d.ts.map +1 -1
  52. package/models/operations/getbrowseranalytics.js +23 -1
  53. package/models/operations/getbrowseranalytics.js.map +1 -1
  54. package/models/operations/getcityanalytics.d.ts +14 -0
  55. package/models/operations/getcityanalytics.d.ts.map +1 -1
  56. package/models/operations/getcityanalytics.js +23 -1
  57. package/models/operations/getcityanalytics.js.map +1 -1
  58. package/models/operations/getclicksanalytics.d.ts +14 -0
  59. package/models/operations/getclicksanalytics.d.ts.map +1 -1
  60. package/models/operations/getclicksanalytics.js +23 -1
  61. package/models/operations/getclicksanalytics.js.map +1 -1
  62. package/models/operations/getcountryanalytics.d.ts +14 -0
  63. package/models/operations/getcountryanalytics.d.ts.map +1 -1
  64. package/models/operations/getcountryanalytics.js +23 -1
  65. package/models/operations/getcountryanalytics.js.map +1 -1
  66. package/models/operations/getdeviceanalytics.d.ts +14 -0
  67. package/models/operations/getdeviceanalytics.d.ts.map +1 -1
  68. package/models/operations/getdeviceanalytics.js +23 -1
  69. package/models/operations/getdeviceanalytics.js.map +1 -1
  70. package/models/operations/getlinkinfo.d.ts +14 -3
  71. package/models/operations/getlinkinfo.d.ts.map +1 -1
  72. package/models/operations/getlinkinfo.js +23 -1
  73. package/models/operations/getlinkinfo.js.map +1 -1
  74. package/models/operations/getlinks.d.ts +14 -0
  75. package/models/operations/getlinks.d.ts.map +1 -1
  76. package/models/operations/getlinks.js +23 -1
  77. package/models/operations/getlinks.js.map +1 -1
  78. package/models/operations/getlinkscount.d.ts +14 -0
  79. package/models/operations/getlinkscount.d.ts.map +1 -1
  80. package/models/operations/getlinkscount.js +23 -1
  81. package/models/operations/getlinkscount.js.map +1 -1
  82. package/models/operations/getosanalytics.d.ts +14 -0
  83. package/models/operations/getosanalytics.d.ts.map +1 -1
  84. package/models/operations/getosanalytics.js +23 -1
  85. package/models/operations/getosanalytics.js.map +1 -1
  86. package/models/operations/getqrcode.d.ts +14 -0
  87. package/models/operations/getqrcode.d.ts.map +1 -1
  88. package/models/operations/getqrcode.js +23 -1
  89. package/models/operations/getqrcode.js.map +1 -1
  90. package/models/operations/getrefereranalytics.d.ts +14 -0
  91. package/models/operations/getrefereranalytics.d.ts.map +1 -1
  92. package/models/operations/getrefereranalytics.js +23 -1
  93. package/models/operations/getrefereranalytics.js.map +1 -1
  94. package/models/operations/gettags.d.ts +14 -0
  95. package/models/operations/gettags.d.ts.map +1 -1
  96. package/models/operations/gettags.js +23 -1
  97. package/models/operations/gettags.js.map +1 -1
  98. package/models/operations/gettimeseriesanalytics.d.ts +14 -0
  99. package/models/operations/gettimeseriesanalytics.d.ts.map +1 -1
  100. package/models/operations/gettimeseriesanalytics.js +23 -1
  101. package/models/operations/gettimeseriesanalytics.js.map +1 -1
  102. package/models/operations/gettoplinks.d.ts +14 -0
  103. package/models/operations/gettoplinks.d.ts.map +1 -1
  104. package/models/operations/gettoplinks.js +23 -1
  105. package/models/operations/gettoplinks.js.map +1 -1
  106. package/models/operations/gettopurls.d.ts +14 -0
  107. package/models/operations/gettopurls.d.ts.map +1 -1
  108. package/models/operations/gettopurls.js +23 -1
  109. package/models/operations/gettopurls.js.map +1 -1
  110. package/models/operations/getworkspace.d.ts +14 -0
  111. package/models/operations/getworkspace.d.ts.map +1 -1
  112. package/models/operations/getworkspace.js +23 -1
  113. package/models/operations/getworkspace.js.map +1 -1
  114. package/models/operations/getworkspaces.d.ts +16 -0
  115. package/models/operations/getworkspaces.d.ts.map +1 -0
  116. package/models/operations/getworkspaces.js +53 -0
  117. package/models/operations/getworkspaces.js.map +1 -0
  118. package/models/operations/index.d.ts +1 -0
  119. package/models/operations/index.d.ts.map +1 -1
  120. package/models/operations/index.js +1 -0
  121. package/models/operations/index.js.map +1 -1
  122. package/package.json +2 -1
  123. package/sdk/analytics.d.ts +10 -10
  124. package/sdk/analytics.d.ts.map +1 -1
  125. package/sdk/analytics.js +160 -138
  126. package/sdk/analytics.js.map +1 -1
  127. package/sdk/links.d.ts +7 -7
  128. package/sdk/links.d.ts.map +1 -1
  129. package/sdk/links.js +112 -111
  130. package/sdk/links.js.map +1 -1
  131. package/sdk/qrcodes.d.ts +1 -1
  132. package/sdk/qrcodes.d.ts.map +1 -1
  133. package/sdk/qrcodes.js +12 -17
  134. package/sdk/qrcodes.js.map +1 -1
  135. package/sdk/tags.d.ts +2 -2
  136. package/sdk/tags.d.ts.map +1 -1
  137. package/sdk/tags.js +32 -34
  138. package/sdk/tags.js.map +1 -1
  139. package/sdk/workspaces.d.ts +3 -3
  140. package/sdk/workspaces.d.ts.map +1 -1
  141. package/sdk/workspaces.js +36 -39
  142. package/sdk/workspaces.js.map +1 -1
  143. package/src/hooks/auth.ts +23 -0
  144. package/src/hooks/base-url.ts +24 -0
  145. package/src/hooks/hooks.ts +5 -1
  146. package/src/hooks/registration.ts +18 -0
  147. package/src/lib/config.ts +3 -3
  148. package/src/models/operations/bulkcreatelinks.ts +35 -0
  149. package/src/models/operations/createlink.ts +35 -0
  150. package/src/models/operations/createtag.ts +35 -0
  151. package/src/models/operations/createworkspace.ts +35 -0
  152. package/src/models/operations/deletelink.ts +35 -0
  153. package/src/models/operations/editlink.ts +35 -0
  154. package/src/models/operations/getbrowseranalytics.ts +35 -0
  155. package/src/models/operations/getcityanalytics.ts +35 -0
  156. package/src/models/operations/getclicksanalytics.ts +35 -0
  157. package/src/models/operations/getcountryanalytics.ts +35 -0
  158. package/src/models/operations/getdeviceanalytics.ts +35 -0
  159. package/src/models/operations/getlinkinfo.ts +35 -3
  160. package/src/models/operations/getlinks.ts +35 -0
  161. package/src/models/operations/getlinkscount.ts +35 -0
  162. package/src/models/operations/getosanalytics.ts +35 -0
  163. package/src/models/operations/getqrcode.ts +35 -0
  164. package/src/models/operations/getrefereranalytics.ts +35 -0
  165. package/src/models/operations/gettags.ts +35 -0
  166. package/src/models/operations/gettimeseriesanalytics.ts +36 -0
  167. package/src/models/operations/gettoplinks.ts +35 -0
  168. package/src/models/operations/gettopurls.ts +35 -0
  169. package/src/models/operations/getworkspace.ts +35 -0
  170. package/src/models/operations/getworkspaces.ts +40 -0
  171. package/src/models/operations/index.ts +1 -0
  172. package/src/sdk/analytics.ts +161 -108
  173. package/src/sdk/links.ts +117 -91
  174. package/src/sdk/qrcodes.ts +13 -14
  175. package/src/sdk/tags.ts +33 -28
  176. package/src/sdk/workspaces.ts +40 -31
@@ -22,16 +22,17 @@ import { Dub } from "dub";
22
22
 
23
23
  async function run() {
24
24
  const sdk = new Dub({
25
- token: "<YOUR_BEARER_TOKEN_HERE>",
26
25
  workspaceId: "<value>",
27
26
  projectSlug: "<value>",
28
27
  });
29
28
 
29
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
30
+
30
31
  const result = await sdk.links.list({
31
32
  tagIds: [
32
33
  "<value>",
33
34
  ],
34
- });
35
+ }, operationSecurity);
35
36
 
36
37
  // Handle the result
37
38
  console.log(result)
@@ -45,6 +46,7 @@ run();
45
46
  | Parameter | Type | Required | Description |
46
47
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
47
48
  | `request` | [operations.GetLinksRequest](../../models/operations/getlinksrequest.md) | :heavy_check_mark: | The request object to use for the request. |
49
+ | `security` | [operations.GetLinksSecurity](../../models/operations/getlinkssecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
48
50
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
49
51
  | `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. |
50
52
 
@@ -78,18 +80,19 @@ import { Dub } from "dub";
78
80
 
79
81
  async function run() {
80
82
  const sdk = new Dub({
81
- token: "<YOUR_BEARER_TOKEN_HERE>",
82
83
  workspaceId: "<value>",
83
84
  projectSlug: "<value>",
84
85
  });
85
86
 
87
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
88
+
86
89
  const result = await sdk.links.create({
87
90
  url: "http://limp-pastry.org",
88
91
  geo: {
89
92
  "key": "<value>",
90
93
  },
91
94
  tagIds: "<value>",
92
- });
95
+ }, operationSecurity);
93
96
 
94
97
  // Handle the result
95
98
  console.log(result)
@@ -103,6 +106,7 @@ run();
103
106
  | Parameter | Type | Required | Description |
104
107
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
105
108
  | `request` | [operations.CreateLinkRequestBody](../../models/operations/createlinkrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
109
+ | `security` | [operations.CreateLinkSecurity](../../models/operations/createlinksecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
106
110
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
107
111
  | `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. |
108
112
 
@@ -137,15 +141,16 @@ import { One } from "dub/models/operations";
137
141
 
138
142
  async function run() {
139
143
  const sdk = new Dub({
140
- token: "<YOUR_BEARER_TOKEN_HERE>",
141
144
  workspaceId: "<value>",
142
145
  projectSlug: "<value>",
143
146
  });
144
147
 
148
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
149
+
145
150
  const result = await sdk.links.count({
146
151
  tagIds: "<value>",
147
152
  groupBy: One.Domain,
148
- });
153
+ }, operationSecurity);
149
154
 
150
155
  // Handle the result
151
156
  console.log(result)
@@ -159,6 +164,7 @@ run();
159
164
  | Parameter | Type | Required | Description |
160
165
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
161
166
  | `request` | [operations.GetLinksCountRequest](../../models/operations/getlinkscountrequest.md) | :heavy_check_mark: | The request object to use for the request. |
167
+ | `security` | [operations.GetLinksCountSecurity](../../models/operations/getlinkscountsecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
162
168
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
163
169
  | `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. |
164
170
 
@@ -192,15 +198,16 @@ import { Dub } from "dub";
192
198
 
193
199
  async function run() {
194
200
  const sdk = new Dub({
195
- token: "<YOUR_BEARER_TOKEN_HERE>",
196
201
  workspaceId: "<value>",
197
202
  projectSlug: "<value>",
198
203
  });
199
204
 
205
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
206
+
200
207
  const result = await sdk.links.get({
201
208
  domain: "ringed-blow.name",
202
209
  key: "<key>",
203
- });
210
+ }, operationSecurity);
204
211
 
205
212
  // Handle the result
206
213
  console.log(result)
@@ -214,6 +221,7 @@ run();
214
221
  | Parameter | Type | Required | Description |
215
222
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
216
223
  | `request` | [operations.GetLinkInfoRequest](../../models/operations/getlinkinforequest.md) | :heavy_check_mark: | The request object to use for the request. |
224
+ | `security` | [operations.GetLinkInfoSecurity](../../models/operations/getlinkinfosecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
217
225
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
218
226
  | `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. |
219
227
 
@@ -247,7 +255,6 @@ import { Dub } from "dub";
247
255
 
248
256
  async function run() {
249
257
  const sdk = new Dub({
250
- token: "<YOUR_BEARER_TOKEN_HERE>",
251
258
  workspaceId: "<value>",
252
259
  projectSlug: "<value>",
253
260
  });
@@ -260,8 +267,9 @@ async function run() {
260
267
  },
261
268
  tagIds: "<value>",
262
269
  };
270
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
263
271
 
264
- const result = await sdk.links.update(linkId, requestBody);
272
+ const result = await sdk.links.update(operationSecurity, linkId, requestBody);
265
273
 
266
274
  // Handle the result
267
275
  console.log(result)
@@ -274,6 +282,7 @@ run();
274
282
 
275
283
  | Parameter | Type | Required | Description |
276
284
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
285
+ | `security` | [operations.EditLinkSecurity](../../models/operations/editlinksecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
277
286
  | `linkId` | *string* | :heavy_check_mark: | The id of the link to edit. You can get this via the `getLinkInfo` endpoint. |
278
287
  | `requestBody` | [operations.EditLinkRequestBody](../../models/operations/editlinkrequestbody.md) | :heavy_minus_sign: | N/A |
279
288
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
@@ -309,14 +318,14 @@ import { Dub } from "dub";
309
318
 
310
319
  async function run() {
311
320
  const sdk = new Dub({
312
- token: "<YOUR_BEARER_TOKEN_HERE>",
313
321
  workspaceId: "<value>",
314
322
  projectSlug: "<value>",
315
323
  });
316
324
 
317
325
  const linkId = "<value>";
326
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
318
327
 
319
- const result = await sdk.links.delete(linkId);
328
+ const result = await sdk.links.delete(operationSecurity, linkId);
320
329
 
321
330
  // Handle the result
322
331
  console.log(result)
@@ -329,6 +338,7 @@ run();
329
338
 
330
339
  | Parameter | Type | Required | Description |
331
340
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
341
+ | `security` | [operations.DeleteLinkSecurity](../../models/operations/deletelinksecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
332
342
  | `linkId` | *string* | :heavy_check_mark: | The id of the link to delete. You can get this via the `getLinkInfo` endpoint. |
333
343
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
334
344
  | `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. |
@@ -363,11 +373,12 @@ import { Dub } from "dub";
363
373
 
364
374
  async function run() {
365
375
  const sdk = new Dub({
366
- token: "<YOUR_BEARER_TOKEN_HERE>",
367
376
  workspaceId: "<value>",
368
377
  projectSlug: "<value>",
369
378
  });
370
379
 
380
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
381
+
371
382
  const result = await sdk.links.createMany([
372
383
  {
373
384
  url: "https://positive-plane.info",
@@ -378,7 +389,7 @@ async function run() {
378
389
  "<value>",
379
390
  ],
380
391
  },
381
- ]);
392
+ ], operationSecurity);
382
393
 
383
394
  // Handle the result
384
395
  console.log(result)
@@ -392,6 +403,7 @@ run();
392
403
  | Parameter | Type | Required | Description |
393
404
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
394
405
  | `request` | [operations.RequestBody[]](../../models/.md) | :heavy_check_mark: | The request object to use for the request. |
406
+ | `security` | [operations.BulkCreateLinksSecurity](../../models/operations/bulkcreatelinkssecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
395
407
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
396
408
  | `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. |
397
409
 
@@ -16,12 +16,13 @@ import { Dub } from "dub";
16
16
 
17
17
  async function run() {
18
18
  const sdk = new Dub({
19
- token: "<YOUR_BEARER_TOKEN_HERE>",
20
19
  workspaceId: "<value>",
21
20
  projectSlug: "<value>",
22
21
  });
23
22
 
24
- const result = await sdk.qrCodes.get({});
23
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
24
+
25
+ const result = await sdk.qrCodes.get({}, operationSecurity);
25
26
 
26
27
  // Handle the result
27
28
  console.log(result)
@@ -35,6 +36,7 @@ run();
35
36
  | Parameter | Type | Required | Description |
36
37
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
37
38
  | `request` | [operations.GetQRCodeRequest](../../models/operations/getqrcoderequest.md) | :heavy_check_mark: | The request object to use for the request. |
39
+ | `security` | [operations.GetQRCodeSecurity](../../models/operations/getqrcodesecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
38
40
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
39
41
  | `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. |
40
42
 
@@ -17,12 +17,13 @@ import { Dub } from "dub";
17
17
 
18
18
  async function run() {
19
19
  const sdk = new Dub({
20
- token: "<YOUR_BEARER_TOKEN_HERE>",
21
20
  workspaceId: "<value>",
22
21
  projectSlug: "<value>",
23
22
  });
24
23
 
25
- const result = await sdk.tags.list({});
24
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
25
+
26
+ const result = await sdk.tags.list({}, operationSecurity);
26
27
 
27
28
  // Handle the result
28
29
  console.log(result)
@@ -36,6 +37,7 @@ run();
36
37
  | Parameter | Type | Required | Description |
37
38
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
38
39
  | `request` | [operations.GetTagsRequest](../../models/operations/gettagsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
40
+ | `security` | [operations.GetTagsSecurity](../../models/operations/gettagssecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
39
41
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
40
42
  | `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. |
41
43
 
@@ -69,14 +71,15 @@ import { Dub } from "dub";
69
71
 
70
72
  async function run() {
71
73
  const sdk = new Dub({
72
- token: "<YOUR_BEARER_TOKEN_HERE>",
73
74
  workspaceId: "<value>",
74
75
  projectSlug: "<value>",
75
76
  });
76
77
 
78
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
79
+
77
80
  const result = await sdk.tags.create({
78
81
  tag: "<value>",
79
- });
82
+ }, operationSecurity);
80
83
 
81
84
  // Handle the result
82
85
  console.log(result)
@@ -90,6 +93,7 @@ run();
90
93
  | Parameter | Type | Required | Description |
91
94
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
92
95
  | `request` | [operations.CreateTagRequestBody](../../models/operations/createtagrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
96
+ | `security` | [operations.CreateTagSecurity](../../models/operations/createtagsecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
93
97
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
94
98
  | `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. |
95
99
 
@@ -18,12 +18,13 @@ import { Dub } from "dub";
18
18
 
19
19
  async function run() {
20
20
  const sdk = new Dub({
21
- token: "<YOUR_BEARER_TOKEN_HERE>",
22
21
  workspaceId: "<value>",
23
22
  projectSlug: "<value>",
24
23
  });
25
24
 
26
- const result = await sdk.workspaces.list();
25
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
26
+
27
+ const result = await sdk.workspaces.list(operationSecurity);
27
28
 
28
29
  // Handle the result
29
30
  console.log(result)
@@ -36,6 +37,7 @@ run();
36
37
 
37
38
  | Parameter | Type | Required | Description |
38
39
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
40
+ | `security` | [operations.GetWorkspacesSecurity](../../models/operations/getworkspacessecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
39
41
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
40
42
  | `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. |
41
43
 
@@ -69,15 +71,16 @@ import { Dub } from "dub";
69
71
 
70
72
  async function run() {
71
73
  const sdk = new Dub({
72
- token: "<YOUR_BEARER_TOKEN_HERE>",
73
74
  workspaceId: "<value>",
74
75
  projectSlug: "<value>",
75
76
  });
76
77
 
78
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
79
+
77
80
  const result = await sdk.workspaces.create({
78
81
  name: "<value>",
79
82
  slug: "<value>",
80
- });
83
+ }, operationSecurity);
81
84
 
82
85
  // Handle the result
83
86
  console.log(result)
@@ -91,6 +94,7 @@ run();
91
94
  | Parameter | Type | Required | Description |
92
95
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
93
96
  | `request` | [operations.CreateWorkspaceRequestBody](../../models/operations/createworkspacerequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
97
+ | `security` | [operations.CreateWorkspaceSecurity](../../models/operations/createworkspacesecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
94
98
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
95
99
  | `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. |
96
100
 
@@ -124,14 +128,15 @@ import { Dub } from "dub";
124
128
 
125
129
  async function run() {
126
130
  const sdk = new Dub({
127
- token: "<YOUR_BEARER_TOKEN_HERE>",
128
131
  workspaceId: "<value>",
129
132
  projectSlug: "<value>",
130
133
  });
131
134
 
135
+ const operationSecurity = "<YOUR_BEARER_TOKEN_HERE>";
136
+
132
137
  const result = await sdk.workspaces.get({
133
138
  idOrSlug: "<value>",
134
- });
139
+ }, operationSecurity);
135
140
 
136
141
  // Handle the result
137
142
  console.log(result)
@@ -145,6 +150,7 @@ run();
145
150
  | Parameter | Type | Required | Description |
146
151
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
147
152
  | `request` | [operations.GetWorkspaceRequest](../../models/operations/getworkspacerequest.md) | :heavy_check_mark: | The request object to use for the request. |
153
+ | `security` | [operations.GetWorkspaceSecurity](../../models/operations/getworkspacesecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
148
154
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
149
155
  | `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. |
150
156
 
@@ -0,0 +1,3 @@
1
+ import { BeforeRequestHook } from "./types";
2
+ export declare const injectAPIKey: BeforeRequestHook;
3
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/hooks/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,YAAY,EAAE,iBAoB1B,CAAC"}
package/hooks/auth.js ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.injectAPIKey = void 0;
4
+ exports.injectAPIKey = {
5
+ beforeRequest: async (_, request) => {
6
+ var _a;
7
+ const authz = request.headers.get("Authorization");
8
+ if (authz) {
9
+ return request;
10
+ }
11
+ let token = "";
12
+ if (typeof process !== "undefined") {
13
+ token = (_a = process.env["DUB_API_KEY"]) !== null && _a !== void 0 ? _a : "";
14
+ }
15
+ if (!token) {
16
+ throw new Error("The DUB_API_KEY environment variable is missing or empty; either provide it, or instantiate the Dub client with an token option, like new Dub({ token: 'My Token' }).");
17
+ }
18
+ request.headers.set("Authorization", `Bearer ${token}`);
19
+ return request;
20
+ },
21
+ };
22
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/hooks/auth.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAAsB;IAC3C,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;;QAChC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACnD,IAAI,KAAK,EAAE,CAAC;YACR,OAAO,OAAO,CAAC;QACnB,CAAC;QAED,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;YACjC,KAAK,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,mCAAI,EAAE,CAAC;QAC7C,CAAC;QAED,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,uKAAuK,CAAC,CAAC;QAC7L,CAAC;QAED,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;QAExD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { BeforeRequestHook } from "./types";
2
+ export declare const overrideBaseURL: BeforeRequestHook;
3
+ //# sourceMappingURL=base-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-url.d.ts","sourceRoot":"","sources":["../src/hooks/base-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,eAAe,EAAE,iBAqB7B,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.overrideBaseURL = void 0;
4
+ exports.overrideBaseURL = {
5
+ beforeRequest: async (_, request) => {
6
+ var _a;
7
+ let baseURL = "";
8
+ if (typeof process !== "undefined") {
9
+ baseURL = (_a = process.env["DUB_BASE_URL"]) !== null && _a !== void 0 ? _a : "";
10
+ }
11
+ if (!baseURL) {
12
+ return request;
13
+ }
14
+ const clone = new URL(request.url);
15
+ const base = new URL(baseURL);
16
+ clone.protocol = base.protocol;
17
+ clone.host = base.host;
18
+ clone.port = base.port;
19
+ clone.username = base.username;
20
+ clone.password = base.password;
21
+ return new Request(clone.toString(), request);
22
+ },
23
+ };
24
+ //# sourceMappingURL=base-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-url.js","sourceRoot":"","sources":["../src/hooks/base-url.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAsB;IAC9C,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;;QAChC,IAAI,OAAO,GAAG,E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,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAUhF,YAAY,CAAC,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAUjF,UAAU,CACZ,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,QAAQ,GAAG,IAAI,EACzB,KAAK,EAAE,OAAO,GACf,OAAO,CAAC;QAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;CAY5D"}
package/hooks/hooks.js CHANGED
@@ -4,12 +4,14 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SDKHooks = void 0;
7
+ const registration_1 = require("./registration");
7
8
  class SDKHooks {
8
9
  constructor() {
9
10
  this.sdkInitHooks = [];
10
11
  this.beforeRequestHooks = [];
11
12
  this.afterSuccessHooks = [];
12
13
  this.afterErrorHooks = [];
14
+ (0, registration_1.initHooks)(this);
13
15
  }
14
16
  registerSDKInitHook(hook) {
15
17
  this.sdkInitHooks.push(hook);
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks/hooks.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAcH,MAAa,QAAQ;IAMjB;QALA,iBAAY,GAAkB,EAAE,CAAC;QACjC,uBAAkB,GAAwB,EAAE,CAAC;QAC7C,sBAAiB,GAAuB,EAAE,CAAC;QAC3C,oBAAe,GAAqB,EAAE,CAAC;IAExB,CAAC;IAEhB,mBAAmB,CAAC,IAAiB;QACjC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,yBAAyB,CAAC,IAAuB;QAC7C,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,wBAAwB,CAAC,IAAsB;QAC3C,IAAI,CAAC,iBAAiB,CA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I,CAAC,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,GAAG,CAAC;IACf,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAA4B,EAAE,QAAkB;QAC/D,IAAI,GAAG,GAAG,QAAQ,CAAC;QAEnB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACxC,GAAG,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,GAAG,CAAC;IACf,CAAC;IAED,KAAK,CAAC,UAAU,CACZ,OAA0B,EAC1B,QAAyB,EACzB,KAAc;QAEd,IAAI,GAAG,GAAG,QAAQ,CAAC;QACnB,IAAI,GAAG,GAAG,KAAK,CAAC;QAEhB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YACxD,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;YACtB,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;QACvB,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACzC,CAAC;CACJ;AAlED,4BAkEC"}
@@ -0,0 +1,3 @@
1
+ import { Hooks } from "./types";
2
+ export declare function initHooks(hooks: Hooks): void;
3
+ //# sourceMappingURL=registration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registration.d.ts","sourceRoot":"","sources":["../src/hooks/registration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAQhC,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,QAOrC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initHooks = void 0;
4
+ const auth_1 = require("./auth");
5
+ const base_url_1 = require("./base-url");
6
+ /*
7
+ * This file is only ever generated once on the first generation and then is free to be modified.
8
+ * Any hooks you wish to add should be registered in the initHooks function. Feel free to define them
9
+ * in this file or in separate files in the hooks folder.
10
+ */
11
+ function initHooks(hooks) {
12
+ // Add hooks by calling hooks.register{ClientInit/BeforeRequest/AfterSuccess/AfterError}Hook
13
+ // with an instance of a hook that implements that specific Hook interface
14
+ // Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance
15
+ hooks.registerBeforeRequestHook(auth_1.injectAPIKey);
16
+ hooks.registerBeforeRequestHook(base_url_1.overrideBaseURL);
17
+ }
18
+ exports.initHooks = initHooks;
19
+ //# sourceMappingURL=registration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registration.js","sourceRoot":"","sources":["../src/hooks/registration.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AACtC,yCAA6C;AAG7C;;;;GAIG;AAEH,SAAgB,SAAS,CAAC,KAAY;IAClC,4FAA4F;IAC5F,0EAA0E;IAC1E,4FAA4F;IAE5F,KAAK,CAAC,yBAAyB,CAAC,mBAAY,CAAC,CAAC;IAC9C,KAAK,CAAC,yBAAyB,CAAC,0BAAe,CAAC,CAAC;AACrD,CAAC;AAPD,8BAOC"}
package/lib/config.d.ts CHANGED
@@ -32,8 +32,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
32
32
  export declare const SDK_METADATA: Readonly<{
33
33
  language: "typescript";
34
34
  openapiDocVersion: "0.0.1";
35
- sdkVersion: "0.20.2";
36
- genVersion: "2.302.0";
37
- userAgent: "speakeasy-sdk/typescript 0.20.2 2.302.0 0.0.1 dub";
35
+ sdkVersion: "0.21.0";
36
+ genVersion: "2.302.1";
37
+ userAgent: "speakeasy-sdk/typescript 0.21.0 2.302.1 0.0.1 dub";
38
38
  }>;
39
39
  //# sourceMappingURL=config.d.ts.map
package/lib/config.js CHANGED
@@ -32,8 +32,8 @@ exports.serverURLFromOptions = serverURLFromOptions;
32
32
  exports.SDK_METADATA = Object.freeze({
33
33
  language: "typescript",
34
34
  openapiDocVersion: "0.0.1",
35
- sdkVersion: "0.20.2",
36
- genVersion: "2.302.0",
37
- userAgent: "speakeasy-sdk/typescript 0.20.2 2.302.0 0.0.1 dub",
35
+ sdkVersion: "0.21.0",
36
+ genVersion: "2.302.1",
37
+ userAgent: "speakeasy-sdk/typescript 0.21.0 2.302.1 0.0.1 dub",
38
38
  });
39
39
  //# sourceMappingURL=config.js.map
@@ -1,4 +1,7 @@
1
1
  import * as z from "zod";
2
+ export type BulkCreateLinksSecurity = {
3
+ token?: string | undefined;
4
+ };
2
5
  /**
3
6
  * The unique IDs of the tags assigned to the short link.
4
7
  */
@@ -88,6 +91,17 @@ export type RequestBody = {
88
91
  comments?: string | null | undefined;
89
92
  };
90
93
  /** @internal */
94
+ export declare namespace BulkCreateLinksSecurity$ {
95
+ type Inbound = {
96
+ token?: string | undefined;
97
+ };
98
+ const inboundSchema: z.ZodType<BulkCreateLinksSecurity, z.ZodTypeDef, Inbound>;
99
+ type Outbound = {
100
+ token?: string | undefined;
101
+ };
102
+ const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, BulkCreateLinksSecurity>;
103
+ }
104
+ /** @internal */
91
105
  export declare namespace BulkCreateLinksTagIds$ {
92
106
  type Inbound = string | Array<string>;
93
107
  type Outbound = string | Array<string>;