@lorikeetai/node-sdk 0.1.0-alpha.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/CHANGELOG.md +18 -0
- package/LICENSE +201 -0
- package/README.md +288 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +242 -0
- package/core.d.ts.map +1 -0
- package/core.js +903 -0
- package/core.js.map +1 -0
- package/core.mjs +871 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +53 -0
- package/error.d.ts.map +1 -0
- package/error.js +143 -0
- package/error.js.map +1 -0
- package/error.mjs +127 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +128 -0
- package/index.d.ts +128 -0
- package/index.d.ts.map +1 -0
- package/index.js +146 -0
- package/index.js.map +1 -0
- package/index.mjs +118 -0
- package/index.mjs.map +1 -0
- package/internal/qs/formats.d.ts +6 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +11 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +8 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +280 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +276 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.ts +14 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +229 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/package.json +103 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/conversation.d.ts +45 -0
- package/resources/conversation.d.ts.map +1 -0
- package/resources/conversation.js +23 -0
- package/resources/conversation.js.map +1 -0
- package/resources/conversation.mjs +19 -0
- package/resources/conversation.mjs.map +1 -0
- package/resources/index.d.ts +3 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +9 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -0
- package/resources/ingest.d.ts +58 -0
- package/resources/ingest.d.ts.map +1 -0
- package/resources/ingest.js +38 -0
- package/resources/ingest.js.map +1 -0
- package/resources/ingest.mjs +34 -0
- package/resources/ingest.mjs.map +1 -0
- package/resources/pets.d.ts +157 -0
- package/resources/pets.d.ts.map +1 -0
- package/resources/pets.js +75 -0
- package/resources/pets.js.map +1 -0
- package/resources/pets.mjs +71 -0
- package/resources/pets.mjs.map +1 -0
- package/resources/shared.d.ts +12 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/store/index.d.ts +3 -0
- package/resources/store/index.d.ts.map +1 -0
- package/resources/store/index.js +9 -0
- package/resources/store/index.js.map +1 -0
- package/resources/store/index.mjs +4 -0
- package/resources/store/index.mjs.map +1 -0
- package/resources/store/order.d.ts +16 -0
- package/resources/store/order.d.ts.map +1 -0
- package/resources/store/order.js +26 -0
- package/resources/store/order.js.map +1 -0
- package/resources/store/order.mjs +22 -0
- package/resources/store/order.mjs.map +1 -0
- package/resources/store/store.d.ts +35 -0
- package/resources/store/store.d.ts.map +1 -0
- package/resources/store/store.js +53 -0
- package/resources/store/store.js.map +1 -0
- package/resources/store/store.mjs +26 -0
- package/resources/store/store.mjs.map +1 -0
- package/resources/user.d.ts +96 -0
- package/resources/user.d.ts.map +1 -0
- package/resources/user.js +65 -0
- package/resources/user.js.map +1 -0
- package/resources/user.mjs +61 -0
- package/resources/user.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1196 -0
- package/src/error.ts +146 -0
- package/src/index.ts +243 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +9 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +388 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +11 -0
- package/src/resources/conversation.ts +62 -0
- package/src/resources/index.ts +15 -0
- package/src/resources/ingest.ts +92 -0
- package/src/resources/pets.ts +276 -0
- package/src/resources/shared.ts +18 -0
- package/src/resources/store/index.ts +4 -0
- package/src/resources/store/order.ts +26 -0
- package/src/resources/store/store.ts +59 -0
- package/src/resources/user.ts +185 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../resource';
|
|
4
|
+
import { isRequestOptions } from '../core';
|
|
5
|
+
import * as Core from '../core';
|
|
6
|
+
import * as PetsAPI from './pets';
|
|
7
|
+
import { type BlobLike } from '../uploads';
|
|
8
|
+
|
|
9
|
+
export class Pets extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Add a new pet to the store
|
|
12
|
+
*/
|
|
13
|
+
create(body: PetCreateParams, options?: Core.RequestOptions): Core.APIPromise<Pet> {
|
|
14
|
+
return this._client.post('/pet', { body, ...options });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Returns a single pet
|
|
19
|
+
*/
|
|
20
|
+
retrieve(petId: number, options?: Core.RequestOptions): Core.APIPromise<Pet> {
|
|
21
|
+
return this._client.get(`/pet/${petId}`, options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Update an existing pet by Id
|
|
26
|
+
*/
|
|
27
|
+
update(body: PetUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Pet> {
|
|
28
|
+
return this._client.put('/pet', { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* delete a pet
|
|
33
|
+
*/
|
|
34
|
+
delete(petId: number, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
35
|
+
return this._client.delete(`/pet/${petId}`, {
|
|
36
|
+
...options,
|
|
37
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Multiple status values can be provided with comma separated strings
|
|
43
|
+
*/
|
|
44
|
+
findByStatus(
|
|
45
|
+
query?: PetFindByStatusParams,
|
|
46
|
+
options?: Core.RequestOptions,
|
|
47
|
+
): Core.APIPromise<PetFindByStatusResponse>;
|
|
48
|
+
findByStatus(options?: Core.RequestOptions): Core.APIPromise<PetFindByStatusResponse>;
|
|
49
|
+
findByStatus(
|
|
50
|
+
query: PetFindByStatusParams | Core.RequestOptions = {},
|
|
51
|
+
options?: Core.RequestOptions,
|
|
52
|
+
): Core.APIPromise<PetFindByStatusResponse> {
|
|
53
|
+
if (isRequestOptions(query)) {
|
|
54
|
+
return this.findByStatus({}, query);
|
|
55
|
+
}
|
|
56
|
+
return this._client.get('/pet/findByStatus', { query, ...options });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
|
61
|
+
* for testing.
|
|
62
|
+
*/
|
|
63
|
+
findByTags(
|
|
64
|
+
query?: PetFindByTagsParams,
|
|
65
|
+
options?: Core.RequestOptions,
|
|
66
|
+
): Core.APIPromise<PetFindByTagsResponse>;
|
|
67
|
+
findByTags(options?: Core.RequestOptions): Core.APIPromise<PetFindByTagsResponse>;
|
|
68
|
+
findByTags(
|
|
69
|
+
query: PetFindByTagsParams | Core.RequestOptions = {},
|
|
70
|
+
options?: Core.RequestOptions,
|
|
71
|
+
): Core.APIPromise<PetFindByTagsResponse> {
|
|
72
|
+
if (isRequestOptions(query)) {
|
|
73
|
+
return this.findByTags({}, query);
|
|
74
|
+
}
|
|
75
|
+
return this._client.get('/pet/findByTags', { query, ...options });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Updates a pet in the store with form data
|
|
80
|
+
*/
|
|
81
|
+
updateById(
|
|
82
|
+
petId: number,
|
|
83
|
+
params?: PetUpdateByIDParams,
|
|
84
|
+
options?: Core.RequestOptions,
|
|
85
|
+
): Core.APIPromise<void>;
|
|
86
|
+
updateById(petId: number, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
87
|
+
updateById(
|
|
88
|
+
petId: number,
|
|
89
|
+
params: PetUpdateByIDParams | Core.RequestOptions = {},
|
|
90
|
+
options?: Core.RequestOptions,
|
|
91
|
+
): Core.APIPromise<void> {
|
|
92
|
+
if (isRequestOptions(params)) {
|
|
93
|
+
return this.updateById(petId, {}, params);
|
|
94
|
+
}
|
|
95
|
+
const { name, status } = params;
|
|
96
|
+
return this._client.post(`/pet/${petId}`, {
|
|
97
|
+
query: { name, status },
|
|
98
|
+
...options,
|
|
99
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* uploads an image
|
|
105
|
+
*/
|
|
106
|
+
uploadImage(
|
|
107
|
+
petId: number,
|
|
108
|
+
params: PetUploadImageParams,
|
|
109
|
+
options?: Core.RequestOptions,
|
|
110
|
+
): Core.APIPromise<APIResponse> {
|
|
111
|
+
const { image, additionalMetadata } = params;
|
|
112
|
+
return this._client.post(`/pet/${petId}/uploadImage`, {
|
|
113
|
+
query: { additionalMetadata },
|
|
114
|
+
body: image,
|
|
115
|
+
...options,
|
|
116
|
+
headers: { 'Content-Type': 'application/octet-stream', ...options?.headers },
|
|
117
|
+
__binaryRequest: true,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface APIResponse {
|
|
123
|
+
code?: number;
|
|
124
|
+
|
|
125
|
+
message?: string;
|
|
126
|
+
|
|
127
|
+
type?: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface Pet {
|
|
131
|
+
name: string;
|
|
132
|
+
|
|
133
|
+
photoUrls: Array<string>;
|
|
134
|
+
|
|
135
|
+
id?: number;
|
|
136
|
+
|
|
137
|
+
category?: Pet.Category;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* pet status in the store
|
|
141
|
+
*/
|
|
142
|
+
status?: 'available' | 'pending' | 'sold';
|
|
143
|
+
|
|
144
|
+
tags?: Array<Pet.Tag>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export namespace Pet {
|
|
148
|
+
export interface Category {
|
|
149
|
+
id?: number;
|
|
150
|
+
|
|
151
|
+
name?: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface Tag {
|
|
155
|
+
id?: number;
|
|
156
|
+
|
|
157
|
+
name?: string;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type PetFindByStatusResponse = Array<Pet>;
|
|
162
|
+
|
|
163
|
+
export type PetFindByTagsResponse = Array<Pet>;
|
|
164
|
+
|
|
165
|
+
export interface PetCreateParams {
|
|
166
|
+
name: string;
|
|
167
|
+
|
|
168
|
+
photoUrls: Array<string>;
|
|
169
|
+
|
|
170
|
+
id?: number;
|
|
171
|
+
|
|
172
|
+
category?: PetCreateParams.Category;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* pet status in the store
|
|
176
|
+
*/
|
|
177
|
+
status?: 'available' | 'pending' | 'sold';
|
|
178
|
+
|
|
179
|
+
tags?: Array<PetCreateParams.Tag>;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export namespace PetCreateParams {
|
|
183
|
+
export interface Category {
|
|
184
|
+
id?: number;
|
|
185
|
+
|
|
186
|
+
name?: string;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface Tag {
|
|
190
|
+
id?: number;
|
|
191
|
+
|
|
192
|
+
name?: string;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export interface PetUpdateParams {
|
|
197
|
+
name: string;
|
|
198
|
+
|
|
199
|
+
photoUrls: Array<string>;
|
|
200
|
+
|
|
201
|
+
id?: number;
|
|
202
|
+
|
|
203
|
+
category?: PetUpdateParams.Category;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* pet status in the store
|
|
207
|
+
*/
|
|
208
|
+
status?: 'available' | 'pending' | 'sold';
|
|
209
|
+
|
|
210
|
+
tags?: Array<PetUpdateParams.Tag>;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export namespace PetUpdateParams {
|
|
214
|
+
export interface Category {
|
|
215
|
+
id?: number;
|
|
216
|
+
|
|
217
|
+
name?: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface Tag {
|
|
221
|
+
id?: number;
|
|
222
|
+
|
|
223
|
+
name?: string;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface PetFindByStatusParams {
|
|
228
|
+
/**
|
|
229
|
+
* Status values that need to be considered for filter
|
|
230
|
+
*/
|
|
231
|
+
status?: 'available' | 'pending' | 'sold';
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface PetFindByTagsParams {
|
|
235
|
+
/**
|
|
236
|
+
* Tags to filter by
|
|
237
|
+
*/
|
|
238
|
+
tags?: Array<string>;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface PetUpdateByIDParams {
|
|
242
|
+
/**
|
|
243
|
+
* Name of pet that needs to be updated
|
|
244
|
+
*/
|
|
245
|
+
name?: string;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Status of pet that needs to be updated
|
|
249
|
+
*/
|
|
250
|
+
status?: string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface PetUploadImageParams {
|
|
254
|
+
/**
|
|
255
|
+
* Body param:
|
|
256
|
+
*/
|
|
257
|
+
image: string | ArrayBufferView | ArrayBuffer | BlobLike;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Query param: Additional Metadata
|
|
261
|
+
*/
|
|
262
|
+
additionalMetadata?: string;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export namespace Pets {
|
|
266
|
+
export import APIResponse = PetsAPI.APIResponse;
|
|
267
|
+
export import Pet = PetsAPI.Pet;
|
|
268
|
+
export import PetFindByStatusResponse = PetsAPI.PetFindByStatusResponse;
|
|
269
|
+
export import PetFindByTagsResponse = PetsAPI.PetFindByTagsResponse;
|
|
270
|
+
export import PetCreateParams = PetsAPI.PetCreateParams;
|
|
271
|
+
export import PetUpdateParams = PetsAPI.PetUpdateParams;
|
|
272
|
+
export import PetFindByStatusParams = PetsAPI.PetFindByStatusParams;
|
|
273
|
+
export import PetFindByTagsParams = PetsAPI.PetFindByTagsParams;
|
|
274
|
+
export import PetUpdateByIDParams = PetsAPI.PetUpdateByIDParams;
|
|
275
|
+
export import PetUploadImageParams = PetsAPI.PetUploadImageParams;
|
|
276
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export interface Order {
|
|
4
|
+
id?: number;
|
|
5
|
+
|
|
6
|
+
complete?: boolean;
|
|
7
|
+
|
|
8
|
+
petId?: number;
|
|
9
|
+
|
|
10
|
+
quantity?: number;
|
|
11
|
+
|
|
12
|
+
shipDate?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Order Status
|
|
16
|
+
*/
|
|
17
|
+
status?: 'placed' | 'approved' | 'delivered';
|
|
18
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import * as Core from '../../core';
|
|
5
|
+
import * as Shared from '../shared';
|
|
6
|
+
|
|
7
|
+
export class Order extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* For valid response try integer IDs with value <= 5 or > 10. Other values will
|
|
10
|
+
* generate exceptions.
|
|
11
|
+
*/
|
|
12
|
+
retrieve(orderId: number, options?: Core.RequestOptions): Core.APIPromise<Shared.Order> {
|
|
13
|
+
return this._client.get(`/store/order/${orderId}`, options);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* For valid response try integer IDs with value < 1000. Anything above 1000 or
|
|
18
|
+
* nonintegers will generate API errors
|
|
19
|
+
*/
|
|
20
|
+
deleteOrder(orderId: number, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
21
|
+
return this._client.delete(`/store/order/${orderId}`, {
|
|
22
|
+
...options,
|
|
23
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import { isRequestOptions } from '../../core';
|
|
5
|
+
import * as Core from '../../core';
|
|
6
|
+
import * as StoreAPI from './store';
|
|
7
|
+
import * as Shared from '../shared';
|
|
8
|
+
import * as OrderAPI from './order';
|
|
9
|
+
|
|
10
|
+
export class Store extends APIResource {
|
|
11
|
+
order: OrderAPI.Order = new OrderAPI.Order(this._client);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Place a new order in the store
|
|
15
|
+
*/
|
|
16
|
+
createOrder(body?: StoreCreateOrderParams, options?: Core.RequestOptions): Core.APIPromise<Shared.Order>;
|
|
17
|
+
createOrder(options?: Core.RequestOptions): Core.APIPromise<Shared.Order>;
|
|
18
|
+
createOrder(
|
|
19
|
+
body: StoreCreateOrderParams | Core.RequestOptions = {},
|
|
20
|
+
options?: Core.RequestOptions,
|
|
21
|
+
): Core.APIPromise<Shared.Order> {
|
|
22
|
+
if (isRequestOptions(body)) {
|
|
23
|
+
return this.createOrder({}, body);
|
|
24
|
+
}
|
|
25
|
+
return this._client.post('/store/order', { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Returns a map of status codes to quantities
|
|
30
|
+
*/
|
|
31
|
+
inventory(options?: Core.RequestOptions): Core.APIPromise<StoreInventoryResponse> {
|
|
32
|
+
return this._client.get('/store/inventory', options);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type StoreInventoryResponse = Record<string, number>;
|
|
37
|
+
|
|
38
|
+
export interface StoreCreateOrderParams {
|
|
39
|
+
id?: number;
|
|
40
|
+
|
|
41
|
+
complete?: boolean;
|
|
42
|
+
|
|
43
|
+
petId?: number;
|
|
44
|
+
|
|
45
|
+
quantity?: number;
|
|
46
|
+
|
|
47
|
+
shipDate?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Order Status
|
|
51
|
+
*/
|
|
52
|
+
status?: 'placed' | 'approved' | 'delivered';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export namespace Store {
|
|
56
|
+
export import StoreInventoryResponse = StoreAPI.StoreInventoryResponse;
|
|
57
|
+
export import StoreCreateOrderParams = StoreAPI.StoreCreateOrderParams;
|
|
58
|
+
export import Order = OrderAPI.Order;
|
|
59
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../resource';
|
|
4
|
+
import { isRequestOptions } from '../core';
|
|
5
|
+
import * as Core from '../core';
|
|
6
|
+
import * as UserAPI from './user';
|
|
7
|
+
|
|
8
|
+
export class UserResource extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* This can only be done by the logged in user.
|
|
11
|
+
*/
|
|
12
|
+
create(body?: UserCreateParams, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
13
|
+
create(options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
14
|
+
create(
|
|
15
|
+
body: UserCreateParams | Core.RequestOptions = {},
|
|
16
|
+
options?: Core.RequestOptions,
|
|
17
|
+
): Core.APIPromise<void> {
|
|
18
|
+
if (isRequestOptions(body)) {
|
|
19
|
+
return this.create({}, body);
|
|
20
|
+
}
|
|
21
|
+
return this._client.post('/user', { body, ...options, headers: { Accept: '*/*', ...options?.headers } });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get user by user name
|
|
26
|
+
*/
|
|
27
|
+
retrieve(username: string, options?: Core.RequestOptions): Core.APIPromise<User> {
|
|
28
|
+
return this._client.get(`/user/${username}`, options);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* This can only be done by the logged in user.
|
|
33
|
+
*/
|
|
34
|
+
update(
|
|
35
|
+
existingUsername: string,
|
|
36
|
+
body?: UserUpdateParams,
|
|
37
|
+
options?: Core.RequestOptions,
|
|
38
|
+
): Core.APIPromise<void>;
|
|
39
|
+
update(existingUsername: string, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
40
|
+
update(
|
|
41
|
+
existingUsername: string,
|
|
42
|
+
body: UserUpdateParams | Core.RequestOptions = {},
|
|
43
|
+
options?: Core.RequestOptions,
|
|
44
|
+
): Core.APIPromise<void> {
|
|
45
|
+
if (isRequestOptions(body)) {
|
|
46
|
+
return this.update(existingUsername, {}, body);
|
|
47
|
+
}
|
|
48
|
+
return this._client.put(`/user/${existingUsername}`, {
|
|
49
|
+
body,
|
|
50
|
+
...options,
|
|
51
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* This can only be done by the logged in user.
|
|
57
|
+
*/
|
|
58
|
+
delete(username: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
59
|
+
return this._client.delete(`/user/${username}`, {
|
|
60
|
+
...options,
|
|
61
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Creates list of users with given input array
|
|
67
|
+
*/
|
|
68
|
+
createWithList(body: UserCreateWithListParams, options?: Core.RequestOptions): Core.APIPromise<User> {
|
|
69
|
+
return this._client.post('/user/createWithList', { body, ...options });
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Logs user into the system
|
|
74
|
+
*/
|
|
75
|
+
login(query?: UserLoginParams, options?: Core.RequestOptions): Core.APIPromise<string>;
|
|
76
|
+
login(options?: Core.RequestOptions): Core.APIPromise<string>;
|
|
77
|
+
login(
|
|
78
|
+
query: UserLoginParams | Core.RequestOptions = {},
|
|
79
|
+
options?: Core.RequestOptions,
|
|
80
|
+
): Core.APIPromise<string> {
|
|
81
|
+
if (isRequestOptions(query)) {
|
|
82
|
+
return this.login({}, query);
|
|
83
|
+
}
|
|
84
|
+
return this._client.get('/user/login', {
|
|
85
|
+
query,
|
|
86
|
+
...options,
|
|
87
|
+
headers: { Accept: 'application/json', ...options?.headers },
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Logs out current logged in user session
|
|
93
|
+
*/
|
|
94
|
+
logout(options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
95
|
+
return this._client.get('/user/logout', { ...options, headers: { Accept: '*/*', ...options?.headers } });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface User {
|
|
100
|
+
id?: number;
|
|
101
|
+
|
|
102
|
+
email?: string;
|
|
103
|
+
|
|
104
|
+
firstName?: string;
|
|
105
|
+
|
|
106
|
+
lastName?: string;
|
|
107
|
+
|
|
108
|
+
password?: string;
|
|
109
|
+
|
|
110
|
+
phone?: string;
|
|
111
|
+
|
|
112
|
+
username?: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* User Status
|
|
116
|
+
*/
|
|
117
|
+
userStatus?: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type UserLoginResponse = string;
|
|
121
|
+
|
|
122
|
+
export interface UserCreateParams {
|
|
123
|
+
id?: number;
|
|
124
|
+
|
|
125
|
+
email?: string;
|
|
126
|
+
|
|
127
|
+
firstName?: string;
|
|
128
|
+
|
|
129
|
+
lastName?: string;
|
|
130
|
+
|
|
131
|
+
password?: string;
|
|
132
|
+
|
|
133
|
+
phone?: string;
|
|
134
|
+
|
|
135
|
+
username?: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* User Status
|
|
139
|
+
*/
|
|
140
|
+
userStatus?: number;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface UserUpdateParams {
|
|
144
|
+
id?: number;
|
|
145
|
+
|
|
146
|
+
email?: string;
|
|
147
|
+
|
|
148
|
+
firstName?: string;
|
|
149
|
+
|
|
150
|
+
lastName?: string;
|
|
151
|
+
|
|
152
|
+
password?: string;
|
|
153
|
+
|
|
154
|
+
phone?: string;
|
|
155
|
+
|
|
156
|
+
username?: string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* User Status
|
|
160
|
+
*/
|
|
161
|
+
userStatus?: number;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export type UserCreateWithListParams = Array<User>;
|
|
165
|
+
|
|
166
|
+
export interface UserLoginParams {
|
|
167
|
+
/**
|
|
168
|
+
* The password for login in clear text
|
|
169
|
+
*/
|
|
170
|
+
password?: string;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* The user name for login
|
|
174
|
+
*/
|
|
175
|
+
username?: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export namespace UserResource {
|
|
179
|
+
export import User = UserAPI.User;
|
|
180
|
+
export import UserLoginResponse = UserAPI.UserLoginResponse;
|
|
181
|
+
export import UserCreateParams = UserAPI.UserCreateParams;
|
|
182
|
+
export import UserUpdateParams = UserAPI.UserUpdateParams;
|
|
183
|
+
export import UserCreateWithListParams = UserAPI.UserCreateWithListParams;
|
|
184
|
+
export import UserLoginParams = UserAPI.UserLoginParams;
|
|
185
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as types from '../_shims/node-types';
|
|
3
|
+
import { setShims } from '../_shims/registry';
|
|
4
|
+
import { getRuntime } from '../_shims/node-runtime';
|
|
5
|
+
setShims(getRuntime());
|
|
6
|
+
|
|
7
|
+
declare module '../_shims/manual-types' {
|
|
8
|
+
export namespace manual {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
export type Agent = types.Agent;
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
export import fetch = types.fetch;
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
export type Request = types.Request;
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
export type RequestInfo = types.RequestInfo;
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
export type RequestInit = types.RequestInit;
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
export type Response = types.Response;
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
export type ResponseInit = types.ResponseInit;
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
export type ResponseType = types.ResponseType;
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
export type BodyInit = types.BodyInit;
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
export type Headers = types.Headers;
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
export type HeadersInit = types.HeadersInit;
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
export type BlobPropertyBag = types.BlobPropertyBag;
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
export type FilePropertyBag = types.FilePropertyBag;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
export type FileFromPathOptions = types.FileFromPathOptions;
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
export import FormData = types.FormData;
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
export import File = types.File;
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
export import Blob = types.Blob;
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
export type Readable = types.Readable;
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
export type FsReadStream = types.FsReadStream;
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
export import ReadableStream = types.ReadableStream;
|
|
49
|
+
}
|
|
50
|
+
}
|
package/src/shims/web.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as types from '../_shims/web-types';
|
|
3
|
+
import { setShims } from '../_shims/registry';
|
|
4
|
+
import { getRuntime } from '../_shims/web-runtime';
|
|
5
|
+
setShims(getRuntime({ manuallyImported: true }));
|
|
6
|
+
|
|
7
|
+
declare module '../_shims/manual-types' {
|
|
8
|
+
export namespace manual {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
export type Agent = types.Agent;
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
export import fetch = types.fetch;
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
export type Request = types.Request;
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
export type RequestInfo = types.RequestInfo;
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
export type RequestInit = types.RequestInit;
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
export type Response = types.Response;
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
export type ResponseInit = types.ResponseInit;
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
export type ResponseType = types.ResponseType;
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
export type BodyInit = types.BodyInit;
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
export type Headers = types.Headers;
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
export type HeadersInit = types.HeadersInit;
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
export type BlobPropertyBag = types.BlobPropertyBag;
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
export type FilePropertyBag = types.FilePropertyBag;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
export type FileFromPathOptions = types.FileFromPathOptions;
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
export import FormData = types.FormData;
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
export import File = types.File;
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
export import Blob = types.Blob;
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
export type Readable = types.Readable;
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
export type FsReadStream = types.FsReadStream;
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
export import ReadableStream = types.ReadableStream;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
// this config is included in the published src directory to prevent TS errors
|
|
3
|
+
// from appearing when users go to source, and VSCode opens the source .ts file
|
|
4
|
+
// via declaration maps
|
|
5
|
+
"include": ["index.ts"],
|
|
6
|
+
"compilerOptions": {
|
|
7
|
+
"target": "es2015",
|
|
8
|
+
"lib": ["DOM"],
|
|
9
|
+
"moduleResolution": "node"
|
|
10
|
+
}
|
|
11
|
+
}
|