@vaultgig/vaultgig-api-client 0.0.1
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.
- package/README.md +135 -0
- package/dist/apis/ContractorsApi.d.ts +78 -0
- package/dist/apis/ContractorsApi.js +302 -0
- package/dist/apis/SchemaApi.d.ts +27 -0
- package/dist/apis/SchemaApi.js +129 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +20 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/BusinessClassification.d.ts +32 -0
- package/dist/models/BusinessClassification.js +58 -0
- package/dist/models/ContractorCreateData.d.ts +32 -0
- package/dist/models/ContractorCreateData.js +51 -0
- package/dist/models/ContractorCreatePayload.d.ts +51 -0
- package/dist/models/ContractorCreatePayload.js +64 -0
- package/dist/models/ContractorData.d.ts +33 -0
- package/dist/models/ContractorData.js +52 -0
- package/dist/models/ContractorResponse.d.ts +88 -0
- package/dist/models/ContractorResponse.js +75 -0
- package/dist/models/ContractorStatus.d.ts +28 -0
- package/dist/models/ContractorStatus.js +54 -0
- package/dist/models/ContractorType.d.ts +25 -0
- package/dist/models/ContractorType.js +51 -0
- package/dist/models/ContractorUpdatePayload.d.ts +106 -0
- package/dist/models/ContractorUpdatePayload.js +77 -0
- package/dist/models/HTTPValidationError.d.ts +33 -0
- package/dist/models/HTTPValidationError.js +50 -0
- package/dist/models/PaginatedResponseContractorResponse.d.ts +52 -0
- package/dist/models/PaginatedResponseContractorResponse.js +61 -0
- package/dist/models/PaginationMeta.d.ts +44 -0
- package/dist/models/PaginationMeta.js +59 -0
- package/dist/models/ResponseContractorCreateData.d.ts +45 -0
- package/dist/models/ResponseContractorCreateData.js +56 -0
- package/dist/models/ResponseContractorData.d.ts +45 -0
- package/dist/models/ResponseContractorData.js +56 -0
- package/dist/models/ResponsePaginatedResponseContractorResponse.d.ts +45 -0
- package/dist/models/ResponsePaginatedResponseContractorResponse.js +56 -0
- package/dist/models/SuccessResponse.d.ts +38 -0
- package/dist/models/SuccessResponse.js +53 -0
- package/dist/models/TinType.d.ts +25 -0
- package/dist/models/TinType.js +51 -0
- package/dist/models/ValidationError.d.ts +45 -0
- package/dist/models/ValidationError.js +60 -0
- package/dist/models/ValidationErrorLocInner.d.ts +26 -0
- package/dist/models/ValidationErrorLocInner.js +39 -0
- package/dist/models/index.d.ts +18 -0
- package/dist/models/index.js +36 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +564 -0
- package/docs/BusinessClassification.md +33 -0
- package/docs/ContractorCreateData.md +35 -0
- package/docs/ContractorCreatePayload.md +41 -0
- package/docs/ContractorData.md +35 -0
- package/docs/ContractorResponse.md +53 -0
- package/docs/ContractorStatus.md +33 -0
- package/docs/ContractorType.md +33 -0
- package/docs/ContractorUpdatePayload.md +59 -0
- package/docs/ContractorsApi.md +308 -0
- package/docs/HTTPValidationError.md +34 -0
- package/docs/PaginatedResponseContractorResponse.md +40 -0
- package/docs/PaginationMeta.md +39 -0
- package/docs/ResponseContractorCreateData.md +38 -0
- package/docs/ResponseContractorData.md +38 -0
- package/docs/ResponsePaginatedResponseContractorResponse.md +38 -0
- package/docs/SchemaApi.md +68 -0
- package/docs/SuccessResponse.md +37 -0
- package/docs/TinType.md +33 -0
- package/docs/ValidationError.md +38 -0
- package/docs/ValidationErrorLocInner.md +32 -0
- package/package.json +19 -0
- package/src/apis/ContractorsApi.ts +280 -0
- package/src/apis/SchemaApi.ts +58 -0
- package/src/apis/index.ts +4 -0
- package/src/index.ts +5 -0
- package/src/models/BusinessClassification.ts +60 -0
- package/src/models/ContractorCreateData.ts +66 -0
- package/src/models/ContractorCreatePayload.ts +103 -0
- package/src/models/ContractorData.ts +74 -0
- package/src/models/ContractorResponse.ts +157 -0
- package/src/models/ContractorStatus.ts +56 -0
- package/src/models/ContractorType.ts +53 -0
- package/src/models/ContractorUpdatePayload.ts +179 -0
- package/src/models/HTTPValidationError.ts +73 -0
- package/src/models/PaginatedResponseContractorResponse.ts +106 -0
- package/src/models/PaginationMeta.ts +84 -0
- package/src/models/ResponseContractorCreateData.ts +90 -0
- package/src/models/ResponseContractorData.ts +90 -0
- package/src/models/ResponsePaginatedResponseContractorResponse.ts +90 -0
- package/src/models/SuccessResponse.ts +74 -0
- package/src/models/TinType.ts +53 -0
- package/src/models/ValidationError.ts +92 -0
- package/src/models/ValidationErrorLocInner.ts +46 -0
- package/src/models/index.ts +20 -0
- package/src/runtime.ts +432 -0
- package/tsconfig.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# @vaultgig/vaultgig-api-client@0.0.1
|
|
2
|
+
|
|
3
|
+
A TypeScript SDK client for the localhost API.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
First, install the SDK from npm.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @vaultgig/vaultgig-api-client --save
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Next, try it out.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import {
|
|
18
|
+
Configuration,
|
|
19
|
+
ContractorsApi,
|
|
20
|
+
} from '@vaultgig/vaultgig-api-client';
|
|
21
|
+
import type { CreateContractorRequest } from '@vaultgig/vaultgig-api-client';
|
|
22
|
+
|
|
23
|
+
async function example() {
|
|
24
|
+
console.log("🚀 Testing @vaultgig/vaultgig-api-client SDK...");
|
|
25
|
+
const api = new ContractorsApi();
|
|
26
|
+
|
|
27
|
+
const body = {
|
|
28
|
+
// string
|
|
29
|
+
organizationId: organizationId_example,
|
|
30
|
+
// ContractorCreatePayload
|
|
31
|
+
contractorCreatePayload: ...,
|
|
32
|
+
} satisfies CreateContractorRequest;
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
const data = await api.createContractor(body);
|
|
36
|
+
console.log(data);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.error(error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Run the test
|
|
43
|
+
example().catch(console.error);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Documentation
|
|
48
|
+
|
|
49
|
+
### API Endpoints
|
|
50
|
+
|
|
51
|
+
All URIs are relative to *http://localhost*
|
|
52
|
+
|
|
53
|
+
| Class | Method | HTTP request | Description
|
|
54
|
+
| ----- | ------ | ------------ | -------------
|
|
55
|
+
*ContractorsApi* | [**createContractor**](docs/ContractorsApi.md#createcontractor) | **POST** /organization/{organization_id}/contractors | Create Contractor
|
|
56
|
+
*ContractorsApi* | [**getContractor**](docs/ContractorsApi.md#getcontractor) | **GET** /organization/{organization_id}/contractors/{contractor_id} | Get Contractor
|
|
57
|
+
*ContractorsApi* | [**getContractors**](docs/ContractorsApi.md#getcontractors) | **GET** /organization/{organization_id}/contractors | Get Contractors
|
|
58
|
+
*ContractorsApi* | [**updateContractor**](docs/ContractorsApi.md#updatecontractor) | **PUT** /organization/{organization_id}/contractors/{contractor_id} | Update Contractor
|
|
59
|
+
*SchemaApi* | [**getYamlSchema**](docs/SchemaApi.md#getyamlschema) | **GET** /openapi.yaml | Get Yaml Schema
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Models
|
|
63
|
+
|
|
64
|
+
- [BusinessClassification](docs/BusinessClassification.md)
|
|
65
|
+
- [ContractorCreateData](docs/ContractorCreateData.md)
|
|
66
|
+
- [ContractorCreatePayload](docs/ContractorCreatePayload.md)
|
|
67
|
+
- [ContractorData](docs/ContractorData.md)
|
|
68
|
+
- [ContractorResponse](docs/ContractorResponse.md)
|
|
69
|
+
- [ContractorStatus](docs/ContractorStatus.md)
|
|
70
|
+
- [ContractorType](docs/ContractorType.md)
|
|
71
|
+
- [ContractorUpdatePayload](docs/ContractorUpdatePayload.md)
|
|
72
|
+
- [HTTPValidationError](docs/HTTPValidationError.md)
|
|
73
|
+
- [PaginatedResponseContractorResponse](docs/PaginatedResponseContractorResponse.md)
|
|
74
|
+
- [PaginationMeta](docs/PaginationMeta.md)
|
|
75
|
+
- [ResponseContractorCreateData](docs/ResponseContractorCreateData.md)
|
|
76
|
+
- [ResponseContractorData](docs/ResponseContractorData.md)
|
|
77
|
+
- [ResponsePaginatedResponseContractorResponse](docs/ResponsePaginatedResponseContractorResponse.md)
|
|
78
|
+
- [SuccessResponse](docs/SuccessResponse.md)
|
|
79
|
+
- [TinType](docs/TinType.md)
|
|
80
|
+
- [ValidationError](docs/ValidationError.md)
|
|
81
|
+
- [ValidationErrorLocInner](docs/ValidationErrorLocInner.md)
|
|
82
|
+
|
|
83
|
+
### Authorization
|
|
84
|
+
|
|
85
|
+
Endpoints do not require authorization.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## About
|
|
89
|
+
|
|
90
|
+
This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/)
|
|
91
|
+
and is automatically generated by the
|
|
92
|
+
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
93
|
+
|
|
94
|
+
- API version: `1.0.0`
|
|
95
|
+
- Package version: `0.0.1`
|
|
96
|
+
- Generator version: `7.18.0-SNAPSHOT`
|
|
97
|
+
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
98
|
+
|
|
99
|
+
The generated npm module supports the following:
|
|
100
|
+
|
|
101
|
+
- Environments
|
|
102
|
+
* Node.js
|
|
103
|
+
* Webpack
|
|
104
|
+
* Browserify
|
|
105
|
+
- Language levels
|
|
106
|
+
* ES5 - you must have a Promises/A+ library installed
|
|
107
|
+
* ES6
|
|
108
|
+
- Module systems
|
|
109
|
+
* CommonJS
|
|
110
|
+
* ES6 module system
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
## Development
|
|
114
|
+
|
|
115
|
+
### Building
|
|
116
|
+
|
|
117
|
+
To build the TypeScript source code, you need to have Node.js and npm installed.
|
|
118
|
+
After cloning the repository, navigate to the project directory and run:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npm install
|
|
122
|
+
npm run build
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Publishing
|
|
126
|
+
|
|
127
|
+
Once you've built the package, you can publish it to npm:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npm publish
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## License
|
|
134
|
+
|
|
135
|
+
[]()
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VaultGig API
|
|
3
|
+
* API for VaultGig contractor management system
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { ContractorCreatePayload, ContractorUpdatePayload, ResponseContractorCreateData, ResponseContractorData, ResponsePaginatedResponseContractorResponse, SuccessResponse } from '../models/index';
|
|
14
|
+
export interface CreateContractorRequest {
|
|
15
|
+
organizationId: string;
|
|
16
|
+
contractorCreatePayload: ContractorCreatePayload;
|
|
17
|
+
}
|
|
18
|
+
export interface GetContractorRequest {
|
|
19
|
+
contractorId: string;
|
|
20
|
+
organizationId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface GetContractorsRequest {
|
|
23
|
+
organizationId: string;
|
|
24
|
+
limit?: number;
|
|
25
|
+
offset?: number;
|
|
26
|
+
tag?: string | null;
|
|
27
|
+
search?: string | null;
|
|
28
|
+
}
|
|
29
|
+
export interface UpdateContractorRequest {
|
|
30
|
+
contractorId: string;
|
|
31
|
+
organizationId: string;
|
|
32
|
+
contractorUpdatePayload: ContractorUpdatePayload;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
export declare class ContractorsApi extends runtime.BaseAPI {
|
|
38
|
+
/**
|
|
39
|
+
* Create a contractor. Args: organization: The organization to update contractor: The contractor data to update
|
|
40
|
+
* Create Contractor
|
|
41
|
+
*/
|
|
42
|
+
createContractorRaw(requestParameters: CreateContractorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResponseContractorCreateData>>;
|
|
43
|
+
/**
|
|
44
|
+
* Create a contractor. Args: organization: The organization to update contractor: The contractor data to update
|
|
45
|
+
* Create Contractor
|
|
46
|
+
*/
|
|
47
|
+
createContractor(requestParameters: CreateContractorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResponseContractorCreateData>;
|
|
48
|
+
/**
|
|
49
|
+
* Get a contractor by ID.
|
|
50
|
+
* Get Contractor
|
|
51
|
+
*/
|
|
52
|
+
getContractorRaw(requestParameters: GetContractorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResponseContractorData>>;
|
|
53
|
+
/**
|
|
54
|
+
* Get a contractor by ID.
|
|
55
|
+
* Get Contractor
|
|
56
|
+
*/
|
|
57
|
+
getContractor(requestParameters: GetContractorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResponseContractorData>;
|
|
58
|
+
/**
|
|
59
|
+
* Get all contractors for an organization. Args: organization: The organization to get contractors for session: The database session
|
|
60
|
+
* Get Contractors
|
|
61
|
+
*/
|
|
62
|
+
getContractorsRaw(requestParameters: GetContractorsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResponsePaginatedResponseContractorResponse>>;
|
|
63
|
+
/**
|
|
64
|
+
* Get all contractors for an organization. Args: organization: The organization to get contractors for session: The database session
|
|
65
|
+
* Get Contractors
|
|
66
|
+
*/
|
|
67
|
+
getContractors(requestParameters: GetContractorsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResponsePaginatedResponseContractorResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Update a contractor. Args: organization: The organization to update contractor_id: The ID of the contractor to update contractor: The contractor data to update
|
|
70
|
+
* Update Contractor
|
|
71
|
+
*/
|
|
72
|
+
updateContractorRaw(requestParameters: UpdateContractorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResponse>>;
|
|
73
|
+
/**
|
|
74
|
+
* Update a contractor. Args: organization: The organization to update contractor_id: The ID of the contractor to update contractor: The contractor data to update
|
|
75
|
+
* Update Contractor
|
|
76
|
+
*/
|
|
77
|
+
updateContractor(requestParameters: UpdateContractorRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponse>;
|
|
78
|
+
}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* VaultGig API
|
|
6
|
+
* API for VaultGig contractor management system
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __extends = (this && this.__extends) || (function () {
|
|
16
|
+
var extendStatics = function (d, b) {
|
|
17
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
+
extendStatics(d, b);
|
|
26
|
+
function __() { this.constructor = d; }
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
40
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
41
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
42
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
43
|
+
function step(op) {
|
|
44
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
45
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
46
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
47
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48
|
+
switch (op[0]) {
|
|
49
|
+
case 0: case 1: t = op; break;
|
|
50
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
51
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
52
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
53
|
+
default:
|
|
54
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
55
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
56
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
57
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58
|
+
if (t[2]) _.ops.pop();
|
|
59
|
+
_.trys.pop(); continue;
|
|
60
|
+
}
|
|
61
|
+
op = body.call(thisArg, _);
|
|
62
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
63
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
+
exports.ContractorsApi = void 0;
|
|
68
|
+
var runtime = require("../runtime");
|
|
69
|
+
var index_1 = require("../models/index");
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
var ContractorsApi = /** @class */ (function (_super) {
|
|
74
|
+
__extends(ContractorsApi, _super);
|
|
75
|
+
function ContractorsApi() {
|
|
76
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Create a contractor. Args: organization: The organization to update contractor: The contractor data to update
|
|
80
|
+
* Create Contractor
|
|
81
|
+
*/
|
|
82
|
+
ContractorsApi.prototype.createContractorRaw = function (requestParameters, initOverrides) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
+
var queryParameters, headerParameters, urlPath, response;
|
|
85
|
+
return __generator(this, function (_a) {
|
|
86
|
+
switch (_a.label) {
|
|
87
|
+
case 0:
|
|
88
|
+
if (requestParameters['organizationId'] == null) {
|
|
89
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling createContractor().');
|
|
90
|
+
}
|
|
91
|
+
if (requestParameters['contractorCreatePayload'] == null) {
|
|
92
|
+
throw new runtime.RequiredError('contractorCreatePayload', 'Required parameter "contractorCreatePayload" was null or undefined when calling createContractor().');
|
|
93
|
+
}
|
|
94
|
+
queryParameters = {};
|
|
95
|
+
headerParameters = {};
|
|
96
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
97
|
+
urlPath = "/organization/{organization_id}/contractors";
|
|
98
|
+
urlPath = urlPath.replace("{".concat("organization_id", "}"), encodeURIComponent(String(requestParameters['organizationId'])));
|
|
99
|
+
return [4 /*yield*/, this.request({
|
|
100
|
+
path: urlPath,
|
|
101
|
+
method: 'POST',
|
|
102
|
+
headers: headerParameters,
|
|
103
|
+
query: queryParameters,
|
|
104
|
+
body: (0, index_1.ContractorCreatePayloadToJSON)(requestParameters['contractorCreatePayload']),
|
|
105
|
+
}, initOverrides)];
|
|
106
|
+
case 1:
|
|
107
|
+
response = _a.sent();
|
|
108
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ResponseContractorCreateDataFromJSON)(jsonValue); })];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Create a contractor. Args: organization: The organization to update contractor: The contractor data to update
|
|
115
|
+
* Create Contractor
|
|
116
|
+
*/
|
|
117
|
+
ContractorsApi.prototype.createContractor = function (requestParameters, initOverrides) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
+
var response;
|
|
120
|
+
return __generator(this, function (_a) {
|
|
121
|
+
switch (_a.label) {
|
|
122
|
+
case 0: return [4 /*yield*/, this.createContractorRaw(requestParameters, initOverrides)];
|
|
123
|
+
case 1:
|
|
124
|
+
response = _a.sent();
|
|
125
|
+
return [4 /*yield*/, response.value()];
|
|
126
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Get a contractor by ID.
|
|
133
|
+
* Get Contractor
|
|
134
|
+
*/
|
|
135
|
+
ContractorsApi.prototype.getContractorRaw = function (requestParameters, initOverrides) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
137
|
+
var queryParameters, headerParameters, urlPath, response;
|
|
138
|
+
return __generator(this, function (_a) {
|
|
139
|
+
switch (_a.label) {
|
|
140
|
+
case 0:
|
|
141
|
+
if (requestParameters['contractorId'] == null) {
|
|
142
|
+
throw new runtime.RequiredError('contractorId', 'Required parameter "contractorId" was null or undefined when calling getContractor().');
|
|
143
|
+
}
|
|
144
|
+
if (requestParameters['organizationId'] == null) {
|
|
145
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getContractor().');
|
|
146
|
+
}
|
|
147
|
+
queryParameters = {};
|
|
148
|
+
headerParameters = {};
|
|
149
|
+
urlPath = "/organization/{organization_id}/contractors/{contractor_id}";
|
|
150
|
+
urlPath = urlPath.replace("{".concat("contractor_id", "}"), encodeURIComponent(String(requestParameters['contractorId'])));
|
|
151
|
+
urlPath = urlPath.replace("{".concat("organization_id", "}"), encodeURIComponent(String(requestParameters['organizationId'])));
|
|
152
|
+
return [4 /*yield*/, this.request({
|
|
153
|
+
path: urlPath,
|
|
154
|
+
method: 'GET',
|
|
155
|
+
headers: headerParameters,
|
|
156
|
+
query: queryParameters,
|
|
157
|
+
}, initOverrides)];
|
|
158
|
+
case 1:
|
|
159
|
+
response = _a.sent();
|
|
160
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ResponseContractorDataFromJSON)(jsonValue); })];
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Get a contractor by ID.
|
|
167
|
+
* Get Contractor
|
|
168
|
+
*/
|
|
169
|
+
ContractorsApi.prototype.getContractor = function (requestParameters, initOverrides) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
171
|
+
var response;
|
|
172
|
+
return __generator(this, function (_a) {
|
|
173
|
+
switch (_a.label) {
|
|
174
|
+
case 0: return [4 /*yield*/, this.getContractorRaw(requestParameters, initOverrides)];
|
|
175
|
+
case 1:
|
|
176
|
+
response = _a.sent();
|
|
177
|
+
return [4 /*yield*/, response.value()];
|
|
178
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Get all contractors for an organization. Args: organization: The organization to get contractors for session: The database session
|
|
185
|
+
* Get Contractors
|
|
186
|
+
*/
|
|
187
|
+
ContractorsApi.prototype.getContractorsRaw = function (requestParameters, initOverrides) {
|
|
188
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
189
|
+
var queryParameters, headerParameters, urlPath, response;
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
192
|
+
case 0:
|
|
193
|
+
if (requestParameters['organizationId'] == null) {
|
|
194
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getContractors().');
|
|
195
|
+
}
|
|
196
|
+
queryParameters = {};
|
|
197
|
+
if (requestParameters['limit'] != null) {
|
|
198
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
199
|
+
}
|
|
200
|
+
if (requestParameters['offset'] != null) {
|
|
201
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
202
|
+
}
|
|
203
|
+
if (requestParameters['tag'] != null) {
|
|
204
|
+
queryParameters['tag'] = requestParameters['tag'];
|
|
205
|
+
}
|
|
206
|
+
if (requestParameters['search'] != null) {
|
|
207
|
+
queryParameters['search'] = requestParameters['search'];
|
|
208
|
+
}
|
|
209
|
+
headerParameters = {};
|
|
210
|
+
urlPath = "/organization/{organization_id}/contractors";
|
|
211
|
+
urlPath = urlPath.replace("{".concat("organization_id", "}"), encodeURIComponent(String(requestParameters['organizationId'])));
|
|
212
|
+
return [4 /*yield*/, this.request({
|
|
213
|
+
path: urlPath,
|
|
214
|
+
method: 'GET',
|
|
215
|
+
headers: headerParameters,
|
|
216
|
+
query: queryParameters,
|
|
217
|
+
}, initOverrides)];
|
|
218
|
+
case 1:
|
|
219
|
+
response = _a.sent();
|
|
220
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.ResponsePaginatedResponseContractorResponseFromJSON)(jsonValue); })];
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Get all contractors for an organization. Args: organization: The organization to get contractors for session: The database session
|
|
227
|
+
* Get Contractors
|
|
228
|
+
*/
|
|
229
|
+
ContractorsApi.prototype.getContractors = function (requestParameters, initOverrides) {
|
|
230
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
231
|
+
var response;
|
|
232
|
+
return __generator(this, function (_a) {
|
|
233
|
+
switch (_a.label) {
|
|
234
|
+
case 0: return [4 /*yield*/, this.getContractorsRaw(requestParameters, initOverrides)];
|
|
235
|
+
case 1:
|
|
236
|
+
response = _a.sent();
|
|
237
|
+
return [4 /*yield*/, response.value()];
|
|
238
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Update a contractor. Args: organization: The organization to update contractor_id: The ID of the contractor to update contractor: The contractor data to update
|
|
245
|
+
* Update Contractor
|
|
246
|
+
*/
|
|
247
|
+
ContractorsApi.prototype.updateContractorRaw = function (requestParameters, initOverrides) {
|
|
248
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
249
|
+
var queryParameters, headerParameters, urlPath, response;
|
|
250
|
+
return __generator(this, function (_a) {
|
|
251
|
+
switch (_a.label) {
|
|
252
|
+
case 0:
|
|
253
|
+
if (requestParameters['contractorId'] == null) {
|
|
254
|
+
throw new runtime.RequiredError('contractorId', 'Required parameter "contractorId" was null or undefined when calling updateContractor().');
|
|
255
|
+
}
|
|
256
|
+
if (requestParameters['organizationId'] == null) {
|
|
257
|
+
throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling updateContractor().');
|
|
258
|
+
}
|
|
259
|
+
if (requestParameters['contractorUpdatePayload'] == null) {
|
|
260
|
+
throw new runtime.RequiredError('contractorUpdatePayload', 'Required parameter "contractorUpdatePayload" was null or undefined when calling updateContractor().');
|
|
261
|
+
}
|
|
262
|
+
queryParameters = {};
|
|
263
|
+
headerParameters = {};
|
|
264
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
265
|
+
urlPath = "/organization/{organization_id}/contractors/{contractor_id}";
|
|
266
|
+
urlPath = urlPath.replace("{".concat("contractor_id", "}"), encodeURIComponent(String(requestParameters['contractorId'])));
|
|
267
|
+
urlPath = urlPath.replace("{".concat("organization_id", "}"), encodeURIComponent(String(requestParameters['organizationId'])));
|
|
268
|
+
return [4 /*yield*/, this.request({
|
|
269
|
+
path: urlPath,
|
|
270
|
+
method: 'PUT',
|
|
271
|
+
headers: headerParameters,
|
|
272
|
+
query: queryParameters,
|
|
273
|
+
body: (0, index_1.ContractorUpdatePayloadToJSON)(requestParameters['contractorUpdatePayload']),
|
|
274
|
+
}, initOverrides)];
|
|
275
|
+
case 1:
|
|
276
|
+
response = _a.sent();
|
|
277
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.SuccessResponseFromJSON)(jsonValue); })];
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Update a contractor. Args: organization: The organization to update contractor_id: The ID of the contractor to update contractor: The contractor data to update
|
|
284
|
+
* Update Contractor
|
|
285
|
+
*/
|
|
286
|
+
ContractorsApi.prototype.updateContractor = function (requestParameters, initOverrides) {
|
|
287
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
288
|
+
var response;
|
|
289
|
+
return __generator(this, function (_a) {
|
|
290
|
+
switch (_a.label) {
|
|
291
|
+
case 0: return [4 /*yield*/, this.updateContractorRaw(requestParameters, initOverrides)];
|
|
292
|
+
case 1:
|
|
293
|
+
response = _a.sent();
|
|
294
|
+
return [4 /*yield*/, response.value()];
|
|
295
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
return ContractorsApi;
|
|
301
|
+
}(runtime.BaseAPI));
|
|
302
|
+
exports.ContractorsApi = ContractorsApi;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VaultGig API
|
|
3
|
+
* API for VaultGig contractor management system
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export declare class SchemaApi extends runtime.BaseAPI {
|
|
17
|
+
/**
|
|
18
|
+
* Get the YAML representation of the OpenAPI schema. Used by the client SDK builder.
|
|
19
|
+
* Get Yaml Schema
|
|
20
|
+
*/
|
|
21
|
+
getYamlSchemaRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<any>>;
|
|
22
|
+
/**
|
|
23
|
+
* Get the YAML representation of the OpenAPI schema. Used by the client SDK builder.
|
|
24
|
+
* Get Yaml Schema
|
|
25
|
+
*/
|
|
26
|
+
getYamlSchema(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<any>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* VaultGig API
|
|
6
|
+
* API for VaultGig contractor management system
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __extends = (this && this.__extends) || (function () {
|
|
16
|
+
var extendStatics = function (d, b) {
|
|
17
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
+
extendStatics(d, b);
|
|
26
|
+
function __() { this.constructor = d; }
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
40
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
41
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
42
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
43
|
+
function step(op) {
|
|
44
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
45
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
46
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
47
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48
|
+
switch (op[0]) {
|
|
49
|
+
case 0: case 1: t = op; break;
|
|
50
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
51
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
52
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
53
|
+
default:
|
|
54
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
55
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
56
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
57
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58
|
+
if (t[2]) _.ops.pop();
|
|
59
|
+
_.trys.pop(); continue;
|
|
60
|
+
}
|
|
61
|
+
op = body.call(thisArg, _);
|
|
62
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
63
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
+
exports.SchemaApi = void 0;
|
|
68
|
+
var runtime = require("../runtime");
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
var SchemaApi = /** @class */ (function (_super) {
|
|
73
|
+
__extends(SchemaApi, _super);
|
|
74
|
+
function SchemaApi() {
|
|
75
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get the YAML representation of the OpenAPI schema. Used by the client SDK builder.
|
|
79
|
+
* Get Yaml Schema
|
|
80
|
+
*/
|
|
81
|
+
SchemaApi.prototype.getYamlSchemaRaw = function (initOverrides) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var queryParameters, headerParameters, urlPath, response;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
switch (_a.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
queryParameters = {};
|
|
88
|
+
headerParameters = {};
|
|
89
|
+
urlPath = "/openapi.yaml";
|
|
90
|
+
return [4 /*yield*/, this.request({
|
|
91
|
+
path: urlPath,
|
|
92
|
+
method: 'GET',
|
|
93
|
+
headers: headerParameters,
|
|
94
|
+
query: queryParameters,
|
|
95
|
+
}, initOverrides)];
|
|
96
|
+
case 1:
|
|
97
|
+
response = _a.sent();
|
|
98
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
99
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response)];
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
103
|
+
}
|
|
104
|
+
return [2 /*return*/];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Get the YAML representation of the OpenAPI schema. Used by the client SDK builder.
|
|
111
|
+
* Get Yaml Schema
|
|
112
|
+
*/
|
|
113
|
+
SchemaApi.prototype.getYamlSchema = function (initOverrides) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
115
|
+
var response;
|
|
116
|
+
return __generator(this, function (_a) {
|
|
117
|
+
switch (_a.label) {
|
|
118
|
+
case 0: return [4 /*yield*/, this.getYamlSchemaRaw(initOverrides)];
|
|
119
|
+
case 1:
|
|
120
|
+
response = _a.sent();
|
|
121
|
+
return [4 /*yield*/, response.value()];
|
|
122
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
return SchemaApi;
|
|
128
|
+
}(runtime.BaseAPI));
|
|
129
|
+
exports.SchemaApi = SchemaApi;
|