@papr/memory 1.5.1 → 1.7.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.
- package/CHANGELOG.md +26 -0
- package/README.md +13 -25
- package/client.d.mts +2 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -5
- package/client.d.ts.map +1 -1
- package/client.js +0 -3
- package/client.js.map +1 -1
- package/client.mjs +0 -3
- package/client.mjs.map +1 -1
- package/internal/shim-types.d.mts +11 -22
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +11 -22
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +2 -2
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +2 -2
- package/internal/shims.d.ts.map +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/package.json +1 -4
- package/resources/index.d.mts +1 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -1
- package/resources/index.mjs.map +1 -1
- package/resources/memory.d.mts +106 -19
- package/resources/memory.d.mts.map +1 -1
- package/resources/memory.d.ts +106 -19
- package/resources/memory.d.ts.map +1 -1
- package/resources/memory.js +9 -1
- package/resources/memory.js.map +1 -1
- package/resources/memory.mjs +9 -1
- package/resources/memory.mjs.map +1 -1
- package/resources/user.d.mts +49 -6
- package/resources/user.d.mts.map +1 -1
- package/resources/user.d.ts +49 -6
- package/resources/user.d.ts.map +1 -1
- package/resources/user.js +16 -2
- package/resources/user.js.map +1 -1
- package/resources/user.mjs +16 -2
- package/resources/user.mjs.map +1 -1
- package/src/client.ts +4 -10
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +2 -2
- package/src/internal/uploads.ts +1 -1
- package/src/resources/index.ts +2 -6
- package/src/resources/memory.ts +153 -21
- package/src/resources/user.ts +66 -5
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/document.d.mts +0 -103
- package/resources/document.d.mts.map +0 -1
- package/resources/document.d.ts +0 -103
- package/resources/document.d.ts.map +0 -1
- package/resources/document.js +0 -33
- package/resources/document.js.map +0 -1
- package/resources/document.mjs +0 -29
- package/resources/document.mjs.map +0 -1
- package/src/internal/shim-types.d.ts +0 -28
- package/src/resources/document.ts +0 -140
package/resources/user.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import * as UserAPI from "./user.js";
|
|
2
3
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
4
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
5
|
export declare class User extends APIResource {
|
|
@@ -32,8 +33,8 @@ export declare class User extends APIResource {
|
|
|
32
33
|
*/
|
|
33
34
|
list(query?: UserListParams | null | undefined, options?: RequestOptions): APIPromise<UserListResponse>;
|
|
34
35
|
/**
|
|
35
|
-
* Delete user association with developer and the user itself by
|
|
36
|
-
* (\_User.objectId)
|
|
36
|
+
* Delete user association with developer and the user itself by , assume external
|
|
37
|
+
* user_id is provided, and resolve to internal user_id (\_User.objectId)
|
|
37
38
|
*
|
|
38
39
|
* @example
|
|
39
40
|
* ```ts
|
|
@@ -41,6 +42,18 @@ export declare class User extends APIResource {
|
|
|
41
42
|
* ```
|
|
42
43
|
*/
|
|
43
44
|
delete(userID: string, options?: RequestOptions): APIPromise<UserDeleteResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Create multiple users or link existing users to developer, and add each to the
|
|
47
|
+
* developer's workspace (if one exists).
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const response = await client.user.createBatch({
|
|
52
|
+
* users: [{ external_id: 'user123' }],
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
createBatch(body: UserCreateBatchParams, options?: RequestOptions): APIPromise<UserCreateBatchResponse>;
|
|
44
57
|
/**
|
|
45
58
|
* Get user details by user_id (\_User.objectId) and developer association
|
|
46
59
|
*
|
|
@@ -68,7 +81,7 @@ export interface UserResponse {
|
|
|
68
81
|
email?: string | null;
|
|
69
82
|
error?: string | null;
|
|
70
83
|
external_id?: string | null;
|
|
71
|
-
metadata?: unknown | null;
|
|
84
|
+
metadata?: Record<string, unknown> | null;
|
|
72
85
|
updated_at?: string | null;
|
|
73
86
|
user_id?: string | null;
|
|
74
87
|
}
|
|
@@ -115,16 +128,32 @@ export interface UserDeleteResponse {
|
|
|
115
128
|
*/
|
|
116
129
|
user_id?: string | null;
|
|
117
130
|
}
|
|
131
|
+
export interface UserCreateBatchResponse {
|
|
132
|
+
/**
|
|
133
|
+
* HTTP status code
|
|
134
|
+
*/
|
|
135
|
+
code: number;
|
|
136
|
+
/**
|
|
137
|
+
* 'success' or 'error'
|
|
138
|
+
*/
|
|
139
|
+
status: string;
|
|
140
|
+
data?: Array<UserResponse> | null;
|
|
141
|
+
details?: unknown;
|
|
142
|
+
error?: string | null;
|
|
143
|
+
page?: number | null;
|
|
144
|
+
page_size?: number | null;
|
|
145
|
+
total?: number | null;
|
|
146
|
+
}
|
|
118
147
|
export interface UserCreateParams {
|
|
119
148
|
external_id: string;
|
|
120
149
|
email?: string | null;
|
|
121
|
-
metadata?: unknown | null;
|
|
150
|
+
metadata?: Record<string, unknown> | null;
|
|
122
151
|
type?: UserType;
|
|
123
152
|
}
|
|
124
153
|
export interface UserUpdateParams {
|
|
125
154
|
email?: string | null;
|
|
126
155
|
external_id?: string | null;
|
|
127
|
-
metadata?: unknown | null;
|
|
156
|
+
metadata?: Record<string, unknown> | null;
|
|
128
157
|
type?: UserType | null;
|
|
129
158
|
}
|
|
130
159
|
export interface UserListParams {
|
|
@@ -133,7 +162,21 @@ export interface UserListParams {
|
|
|
133
162
|
page?: number;
|
|
134
163
|
page_size?: number;
|
|
135
164
|
}
|
|
165
|
+
export interface UserCreateBatchParams {
|
|
166
|
+
users: Array<UserCreateBatchParams.User>;
|
|
167
|
+
}
|
|
168
|
+
export declare namespace UserCreateBatchParams {
|
|
169
|
+
/**
|
|
170
|
+
* Request model for creating a user
|
|
171
|
+
*/
|
|
172
|
+
interface User {
|
|
173
|
+
external_id: string;
|
|
174
|
+
email?: string | null;
|
|
175
|
+
metadata?: Record<string, unknown> | null;
|
|
176
|
+
type?: UserAPI.UserType;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
136
179
|
export declare namespace User {
|
|
137
|
-
export { type UserResponse as UserResponse, type UserType as UserType, type UserListResponse as UserListResponse, type UserDeleteResponse as UserDeleteResponse, type UserCreateParams as UserCreateParams, type UserUpdateParams as UserUpdateParams, type UserListParams as UserListParams, };
|
|
180
|
+
export { type UserResponse as UserResponse, type UserType as UserType, type UserListResponse as UserListResponse, type UserDeleteResponse as UserDeleteResponse, type UserCreateBatchResponse as UserCreateBatchResponse, type UserCreateParams as UserCreateParams, type UserUpdateParams as UserUpdateParams, type UserListParams as UserListParams, type UserCreateBatchParams as UserCreateBatchParams, };
|
|
138
181
|
}
|
|
139
182
|
//# sourceMappingURL=user.d.ts.map
|
package/resources/user.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../src/resources/user.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC;IAIlF;;;;;;;OAOG;IACH,MAA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AAuB,EACvD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
|
package/resources/user.js
CHANGED
|
@@ -41,8 +41,8 @@ class User extends resource_1.APIResource {
|
|
|
41
41
|
return this._client.get('/v1/user', { query, ...options });
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Delete user association with developer and the user itself by
|
|
45
|
-
* (\_User.objectId)
|
|
44
|
+
* Delete user association with developer and the user itself by , assume external
|
|
45
|
+
* user_id is provided, and resolve to internal user_id (\_User.objectId)
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
48
|
* ```ts
|
|
@@ -52,6 +52,20 @@ class User extends resource_1.APIResource {
|
|
|
52
52
|
delete(userID, options) {
|
|
53
53
|
return this._client.delete((0, path_1.path) `/v1/user/${userID}`, options);
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Create multiple users or link existing users to developer, and add each to the
|
|
57
|
+
* developer's workspace (if one exists).
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const response = await client.user.createBatch({
|
|
62
|
+
* users: [{ external_id: 'user123' }],
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
createBatch(body, options) {
|
|
67
|
+
return this._client.post('/v1/user/batch', { body, ...options });
|
|
68
|
+
}
|
|
55
69
|
/**
|
|
56
70
|
* Get user details by user_id (\_User.objectId) and developer association
|
|
57
71
|
*
|
package/resources/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../src/resources/user.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../src/resources/user.ts"],"names":[],"mappings":";AAA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s
CHANGED
|
@@ -38,8 +38,8 @@ export class User extends APIResource {
|
|
|
38
38
|
return this._client.get('/v1/user', { query, ...options });
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* Delete user association with developer and the user itself by
|
|
42
|
-
* (\_User.objectId)
|
|
41
|
+
* Delete user association with developer and the user itself by , assume external
|
|
42
|
+
* user_id is provided, and resolve to internal user_id (\_User.objectId)
|
|
43
43
|
*
|
|
44
44
|
* @example
|
|
45
45
|
* ```ts
|
|
@@ -49,6 +49,20 @@ export class User extends APIResource {
|
|
|
49
49
|
delete(userID, options) {
|
|
50
50
|
return this._client.delete(path `/v1/user/${userID}`, options);
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Create multiple users or link existing users to developer, and add each to the
|
|
54
|
+
* developer's workspace (if one exists).
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const response = await client.user.createBatch({
|
|
59
|
+
* users: [{ external_id: 'user123' }],
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
createBatch(body, options) {
|
|
64
|
+
return this._client.post('/v1/user/batch', { body, ...options });
|
|
65
|
+
}
|
|
52
66
|
/**
|
|
53
67
|
* Get user details by user_id (\_User.objectId) and developer association
|
|
54
68
|
*
|
package/resources/user.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.mjs","sourceRoot":"","sources":["../src/resources/user.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"user.mjs","sourceRoot":"","sources":["../src/resources/user.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,MAAc,EAAE,IAAsB,EAAE,OAAwB;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAc,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,YAAY,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;OAUG;IACH,WAAW,CAAC,IAA2B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,MAAc,EAAE,OAAwB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,YAAY,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -20,7 +20,6 @@ import { APIPromise } from './core/api-promise';
|
|
|
20
20
|
import { type Fetch } from './internal/builtin-types';
|
|
21
21
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
22
22
|
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
|
|
23
|
-
import { AddMemoryItem, Document, DocumentUploadParams, DocumentUploadResponse } from './resources/document';
|
|
24
23
|
import {
|
|
25
24
|
AddMemory,
|
|
26
25
|
AddMemoryResponse,
|
|
@@ -41,6 +40,8 @@ import {
|
|
|
41
40
|
} from './resources/memory';
|
|
42
41
|
import {
|
|
43
42
|
User,
|
|
43
|
+
UserCreateBatchParams,
|
|
44
|
+
UserCreateBatchResponse,
|
|
44
45
|
UserCreateParams,
|
|
45
46
|
UserDeleteResponse,
|
|
46
47
|
UserListParams,
|
|
@@ -743,11 +744,9 @@ export class Papr {
|
|
|
743
744
|
|
|
744
745
|
user: API.User = new API.User(this);
|
|
745
746
|
memory: API.Memory = new API.Memory(this);
|
|
746
|
-
document: API.Document = new API.Document(this);
|
|
747
747
|
}
|
|
748
748
|
Papr.User = User;
|
|
749
749
|
Papr.Memory = Memory;
|
|
750
|
-
Papr.Document = Document;
|
|
751
750
|
export declare namespace Papr {
|
|
752
751
|
export type RequestOptions = Opts.RequestOptions;
|
|
753
752
|
|
|
@@ -757,9 +756,11 @@ export declare namespace Papr {
|
|
|
757
756
|
type UserType as UserType,
|
|
758
757
|
type UserListResponse as UserListResponse,
|
|
759
758
|
type UserDeleteResponse as UserDeleteResponse,
|
|
759
|
+
type UserCreateBatchResponse as UserCreateBatchResponse,
|
|
760
760
|
type UserCreateParams as UserCreateParams,
|
|
761
761
|
type UserUpdateParams as UserUpdateParams,
|
|
762
762
|
type UserListParams as UserListParams,
|
|
763
|
+
type UserCreateBatchParams as UserCreateBatchParams,
|
|
763
764
|
};
|
|
764
765
|
|
|
765
766
|
export {
|
|
@@ -780,11 +781,4 @@ export declare namespace Papr {
|
|
|
780
781
|
type MemoryAddBatchParams as MemoryAddBatchParams,
|
|
781
782
|
type MemorySearchParams as MemorySearchParams,
|
|
782
783
|
};
|
|
783
|
-
|
|
784
|
-
export {
|
|
785
|
-
Document as Document,
|
|
786
|
-
type AddMemoryItem as AddMemoryItem,
|
|
787
|
-
type DocumentUploadResponse as DocumentUploadResponse,
|
|
788
|
-
type DocumentUploadParams as DocumentUploadParams,
|
|
789
|
-
};
|
|
790
784
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shims for types that we can't always rely on being available globally.
|
|
5
|
+
*
|
|
6
|
+
* Note: these only exist at the type-level, there is no corresponding runtime
|
|
7
|
+
* version for any of these symbols.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
type NeverToAny<T> = T extends never ? any : T;
|
|
11
|
+
|
|
12
|
+
/** @ts-ignore */
|
|
13
|
+
type _DOMReadableStream<R = any> = globalThis.ReadableStream<R>;
|
|
14
|
+
|
|
15
|
+
/** @ts-ignore */
|
|
16
|
+
type _NodeReadableStream<R = any> = import('stream/web').ReadableStream<R>;
|
|
17
|
+
|
|
18
|
+
type _ConditionalNodeReadableStream<R = any> =
|
|
19
|
+
typeof globalThis extends { ReadableStream: any } ? never : _NodeReadableStream<R>;
|
|
20
|
+
|
|
21
|
+
type _ReadableStream<R = any> = NeverToAny<
|
|
22
|
+
| ([0] extends [1 & _DOMReadableStream<R>] ? never : _DOMReadableStream<R>)
|
|
23
|
+
| ([0] extends [1 & _ConditionalNodeReadableStream<R>] ? never : _ConditionalNodeReadableStream<R>)
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
export type { _ReadableStream as ReadableStream };
|
package/src/internal/shims.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* messages in cases where an environment isn't fully supported.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import type { Fetch } from './builtin-types';
|
|
11
|
+
import type { ReadableStream } from './shim-types';
|
|
12
12
|
|
|
13
13
|
export function getDefaultFetch(): Fetch {
|
|
14
14
|
if (typeof fetch !== 'undefined') {
|
package/src/internal/uploads.ts
CHANGED
|
@@ -138,7 +138,7 @@ export const createForm = async <T = Record<string, unknown>>(
|
|
|
138
138
|
|
|
139
139
|
// We check for Blob not File because Bun.File doesn't inherit from File,
|
|
140
140
|
// but they both inherit from Blob and have a `name` property at runtime.
|
|
141
|
-
const isNamedBlob = (value:
|
|
141
|
+
const isNamedBlob = (value: unknown) => value instanceof Blob && 'name' in value;
|
|
142
142
|
|
|
143
143
|
const isUploadable = (value: unknown) =>
|
|
144
144
|
typeof value === 'object' &&
|
package/src/resources/index.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
4
|
-
Document,
|
|
5
|
-
type AddMemoryItem,
|
|
6
|
-
type DocumentUploadResponse,
|
|
7
|
-
type DocumentUploadParams,
|
|
8
|
-
} from './document';
|
|
9
3
|
export {
|
|
10
4
|
Memory,
|
|
11
5
|
type AddMemory,
|
|
@@ -30,7 +24,9 @@ export {
|
|
|
30
24
|
type UserType,
|
|
31
25
|
type UserListResponse,
|
|
32
26
|
type UserDeleteResponse,
|
|
27
|
+
type UserCreateBatchResponse,
|
|
33
28
|
type UserCreateParams,
|
|
34
29
|
type UserUpdateParams,
|
|
35
30
|
type UserListParams,
|
|
31
|
+
type UserCreateBatchParams,
|
|
36
32
|
} from './user';
|