@devrev/typescript-sdk 1.0.2 → 1.1.3

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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -48
  3. package/package.json +17 -10
  4. package/.eslintignore +0 -2
  5. package/.github/workflows/npm-publish.yml +0 -27
  6. package/.prettierignore +0 -4
  7. package/.prettierrc +0 -15
  8. package/.vscode/extensions.json +0 -8
  9. package/.vscode/launch.json +0 -17
  10. package/.vscode/settings.json +0 -31
  11. package/USER_README.md +0 -16
  12. package/nodemon.json +0 -5
  13. package/src/auto-generated/beta/beta-devrev-sdk.ts +0 -1826
  14. package/src/auto-generated/internal/private-internal-devrev-sdk.ts +0 -54739
  15. package/src/auto-generated/public-devrev-sdk.ts +0 -4009
  16. package/src/beta-data-contracts.json +0 -3271
  17. package/src/client_setup.ts +0 -64
  18. package/src/private-internal-data-contracts.json +0 -98025
  19. package/src/public-data-contracts.json +0 -6922
  20. package/src/workflow/workflow.test.ts +0 -26
  21. package/src/workflow/workflow.ts +0 -54
  22. package/templates/README.md +0 -17
  23. package/templates/base/README.md +0 -8
  24. package/templates/base/data-contract-jsdoc.ejs +0 -37
  25. package/templates/base/data-contracts.ejs +0 -28
  26. package/templates/base/enum-data-contract.ejs +0 -12
  27. package/templates/base/http-client.ejs +0 -3
  28. package/templates/base/http-clients/axios-http-client.ejs +0 -138
  29. package/templates/base/http-clients/fetch-http-client.ejs +0 -224
  30. package/templates/base/interface-data-contract.ejs +0 -10
  31. package/templates/base/object-field-jsdoc.ejs +0 -28
  32. package/templates/base/route-docs.ejs +0 -30
  33. package/templates/base/route-name.ejs +0 -43
  34. package/templates/base/route-type.ejs +0 -22
  35. package/templates/base/type-data-contract.ejs +0 -15
  36. package/templates/default/README.md +0 -7
  37. package/templates/default/api.ejs +0 -64
  38. package/templates/default/procedure-call.ejs +0 -100
  39. package/templates/default/route-types.ejs +0 -26
  40. package/templates/modular/README.md +0 -7
  41. package/templates/modular/api.ejs +0 -28
  42. package/templates/modular/procedure-call.ejs +0 -100
  43. package/templates/modular/route-types.ejs +0 -18
  44. package/tsconfig.eslint.json +0 -4
  45. package/tsconfig.json +0 -25
@@ -1,64 +0,0 @@
1
- import { AxiosRequestConfig } from 'axios';
2
- import * as Beta from './auto-generated/beta/beta-devrev-sdk';
3
- import * as Sdk from './auto-generated/public-devrev-sdk';
4
-
5
- export function setup(url = 'http://api.devrev.ai', token = process.env.SDK_TOKEN) {
6
-
7
- const axiosConfig: AxiosRequestConfig = {
8
- baseURL: url,
9
- headers: {
10
- Authorization: token,
11
- },
12
- };
13
- const devrevSDK = new Sdk.Api({
14
- ...axiosConfig,
15
- });
16
-
17
- devrevSDK.instance.interceptors.request.use((config) => {
18
- for (const key in config.params) {
19
- // Check if the property is an array
20
- if (Array.isArray(config.params[key])) {
21
- // Join the array with a comma
22
- config.params[key] = config.params[key]
23
- .map((value: any) => {
24
- return `"${value}"`;
25
- })
26
- .join(',');
27
- }
28
- }
29
- return config;
30
- });
31
-
32
- //add this in
33
- return devrevSDK;
34
- }
35
-
36
- export function setupBeta(url = 'http://api.devrev.ai', token = process.env.SDK_TOKEN) {
37
-
38
- const axiosConfig: AxiosRequestConfig = {
39
- baseURL: url,
40
- headers: {
41
- Authorization: token,
42
- 'X-Devrev-Scope': 'beta',
43
- },
44
- };
45
- const devrevSDK = new Beta.Api({
46
- ...axiosConfig,
47
- });
48
-
49
- devrevSDK.instance.interceptors.request.use((config) => {
50
- for (const key in config.params) {
51
- // Check if the property is an array
52
- if (Array.isArray(config.params[key])) {
53
- // Join the array with a comma
54
- config.params[key] = config.params[key]
55
- .map((value: any) => {
56
- return `"${value}"`;
57
- })
58
- .join(',');
59
- }
60
- }
61
- return config;
62
- });
63
- return devrevSDK;
64
- }