@papr/memory 1.8.3 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +17 -15
  3. package/client.d.mts +2 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js +1 -1
  8. package/client.js.map +1 -1
  9. package/client.mjs +1 -1
  10. package/client.mjs.map +1 -1
  11. package/index.d.mts +1 -0
  12. package/index.d.ts +1 -0
  13. package/index.js +2 -0
  14. package/index.js.map +1 -1
  15. package/index.mjs +1 -0
  16. package/internal/utils/log.js +1 -1
  17. package/internal/utils/log.js.map +1 -1
  18. package/internal/utils/log.mjs +1 -1
  19. package/internal/utils/log.mjs.map +1 -1
  20. package/package.json +1 -1
  21. package/resources/index.d.mts +1 -1
  22. package/resources/index.d.mts.map +1 -1
  23. package/resources/index.d.ts +1 -1
  24. package/resources/index.d.ts.map +1 -1
  25. package/resources/index.js.map +1 -1
  26. package/resources/index.mjs.map +1 -1
  27. package/resources/memory.d.mts +19 -2
  28. package/resources/memory.d.mts.map +1 -1
  29. package/resources/memory.d.ts +19 -2
  30. package/resources/memory.d.ts.map +1 -1
  31. package/resources/user.d.mts +84 -12
  32. package/resources/user.d.mts.map +1 -1
  33. package/resources/user.d.ts +84 -12
  34. package/resources/user.d.ts.map +1 -1
  35. package/resources/user.js +56 -17
  36. package/resources/user.js.map +1 -1
  37. package/resources/user.mjs +56 -17
  38. package/resources/user.mjs.map +1 -1
  39. package/src/client.ts +3 -1
  40. package/src/index.ts +2 -0
  41. package/src/internal/utils/log.ts +1 -1
  42. package/src/resources/index.ts +1 -0
  43. package/src/resources/memory.ts +32 -4
  44. package/src/resources/user.ts +126 -25
  45. package/src/version.ts +1 -1
  46. package/version.d.mts +1 -1
  47. package/version.d.ts +1 -1
  48. package/version.js +1 -1
  49. package/version.mjs +1 -1
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as UserAPI from './user';
5
5
  import { APIPromise } from '../core/api-promise';
6
+ import { buildHeaders } from '../internal/headers';
6
7
  import { RequestOptions } from '../internal/request-options';
7
8
  import { path } from '../internal/utils/path';
8
9
 
@@ -14,11 +15,17 @@ export class User extends APIResource {
14
15
  * ```ts
15
16
  * const userResponse = await client.user.create({
16
17
  * external_id: 'user123',
18
+ * 'X-API-Key': 'X-API-Key',
17
19
  * });
18
20
  * ```
19
21
  */
20
- create(body: UserCreateParams, options?: RequestOptions): APIPromise<UserResponse> {
21
- return this._client.post('/v1/user', { body, ...options });
22
+ create(params: UserCreateParams, options?: RequestOptions): APIPromise<UserResponse> {
23
+ const { 'X-API-Key': xAPIKey, ...body } = params;
24
+ return this._client.post('/v1/user', {
25
+ body,
26
+ ...options,
27
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
28
+ });
22
29
  }
23
30
 
24
31
  /**
@@ -26,11 +33,18 @@ export class User extends APIResource {
26
33
  *
27
34
  * @example
28
35
  * ```ts
29
- * const userResponse = await client.user.update('user_id');
36
+ * const userResponse = await client.user.update('user_id', {
37
+ * 'X-API-Key': 'X-API-Key',
38
+ * });
30
39
  * ```
31
40
  */
32
- update(userID: string, body: UserUpdateParams, options?: RequestOptions): APIPromise<UserResponse> {
33
- return this._client.put(path`/v1/user/${userID}`, { body, ...options });
41
+ update(userID: string, params: UserUpdateParams, options?: RequestOptions): APIPromise<UserResponse> {
42
+ const { 'X-API-Key': xAPIKey, ...body } = params;
43
+ return this._client.put(path`/v1/user/${userID}`, {
44
+ body,
45
+ ...options,
46
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
47
+ });
34
48
  }
35
49
 
36
50
  /**
@@ -38,14 +52,18 @@ export class User extends APIResource {
38
52
  *
39
53
  * @example
40
54
  * ```ts
41
- * const users = await client.user.list();
55
+ * const users = await client.user.list({
56
+ * 'X-API-Key': 'X-API-Key',
57
+ * });
42
58
  * ```
43
59
  */
44
- list(
45
- query: UserListParams | null | undefined = {},
46
- options?: RequestOptions,
47
- ): APIPromise<UserListResponse> {
48
- return this._client.get('/v1/user', { query, ...options });
60
+ list(params: UserListParams, options?: RequestOptions): APIPromise<UserListResponse> {
61
+ const { 'X-API-Key': xAPIKey, ...query } = params;
62
+ return this._client.get('/v1/user', {
63
+ query,
64
+ ...options,
65
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
66
+ });
49
67
  }
50
68
 
51
69
  /**
@@ -54,16 +72,18 @@ export class User extends APIResource {
54
72
  *
55
73
  * @example
56
74
  * ```ts
57
- * const user = await client.user.delete('user_id');
75
+ * const user = await client.user.delete('user_id', {
76
+ * 'X-API-Key': 'X-API-Key',
77
+ * });
58
78
  * ```
59
79
  */
60
- delete(
61
- userID: string,
62
- params: UserDeleteParams | null | undefined = {},
63
- options?: RequestOptions,
64
- ): APIPromise<UserDeleteResponse> {
65
- const { is_external } = params ?? {};
66
- return this._client.delete(path`/v1/user/${userID}`, { query: { is_external }, ...options });
80
+ delete(userID: string, params: UserDeleteParams, options?: RequestOptions): APIPromise<UserDeleteResponse> {
81
+ const { 'X-API-Key': xAPIKey, is_external } = params;
82
+ return this._client.delete(path`/v1/user/${userID}`, {
83
+ query: { is_external },
84
+ ...options,
85
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
86
+ });
67
87
  }
68
88
 
69
89
  /**
@@ -74,11 +94,17 @@ export class User extends APIResource {
74
94
  * ```ts
75
95
  * const response = await client.user.createBatch({
76
96
  * users: [{ external_id: 'user123' }],
97
+ * 'X-API-Key': 'X-API-Key',
77
98
  * });
78
99
  * ```
79
100
  */
80
- createBatch(body: UserCreateBatchParams, options?: RequestOptions): APIPromise<UserCreateBatchResponse> {
81
- return this._client.post('/v1/user/batch', { body, ...options });
101
+ createBatch(params: UserCreateBatchParams, options?: RequestOptions): APIPromise<UserCreateBatchResponse> {
102
+ const { 'X-API-Key': xAPIKey, ...body } = params;
103
+ return this._client.post('/v1/user/batch', {
104
+ body,
105
+ ...options,
106
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
107
+ });
82
108
  }
83
109
 
84
110
  /**
@@ -86,11 +112,17 @@ export class User extends APIResource {
86
112
  *
87
113
  * @example
88
114
  * ```ts
89
- * const userResponse = await client.user.get('user_id');
115
+ * const userResponse = await client.user.get('user_id', {
116
+ * 'X-API-Key': 'X-API-Key',
117
+ * });
90
118
  * ```
91
119
  */
92
- get(userID: string, options?: RequestOptions): APIPromise<UserResponse> {
93
- return this._client.get(path`/v1/user/${userID}`, options);
120
+ get(userID: string, params: UserGetParams, options?: RequestOptions): APIPromise<UserResponse> {
121
+ const { 'X-API-Key': xAPIKey } = params;
122
+ return this._client.get(path`/v1/user/${userID}`, {
123
+ ...options,
124
+ headers: buildHeaders([{ 'X-API-Key': xAPIKey }, options?.headers]),
125
+ });
94
126
  }
95
127
  }
96
128
 
@@ -208,44 +240,108 @@ export interface UserCreateBatchResponse {
208
240
  }
209
241
 
210
242
  export interface UserCreateParams {
243
+ /**
244
+ * Body param:
245
+ */
211
246
  external_id: string;
212
247
 
248
+ /**
249
+ * Header param:
250
+ */
251
+ 'X-API-Key': string;
252
+
253
+ /**
254
+ * Body param:
255
+ */
213
256
  email?: string | null;
214
257
 
258
+ /**
259
+ * Body param:
260
+ */
215
261
  metadata?: unknown | null;
216
262
 
263
+ /**
264
+ * Body param:
265
+ */
217
266
  type?: UserType;
218
267
  }
219
268
 
220
269
  export interface UserUpdateParams {
270
+ /**
271
+ * Header param:
272
+ */
273
+ 'X-API-Key': string;
274
+
275
+ /**
276
+ * Body param:
277
+ */
221
278
  email?: string | null;
222
279
 
280
+ /**
281
+ * Body param:
282
+ */
223
283
  external_id?: string | null;
224
284
 
285
+ /**
286
+ * Body param:
287
+ */
225
288
  metadata?: unknown | null;
226
289
 
290
+ /**
291
+ * Body param:
292
+ */
227
293
  type?: UserType | null;
228
294
  }
229
295
 
230
296
  export interface UserListParams {
297
+ /**
298
+ * Header param:
299
+ */
300
+ 'X-API-Key': string;
301
+
302
+ /**
303
+ * Query param:
304
+ */
231
305
  email?: string | null;
232
306
 
307
+ /**
308
+ * Query param:
309
+ */
233
310
  external_id?: string | null;
234
311
 
312
+ /**
313
+ * Query param:
314
+ */
235
315
  page?: number;
236
316
 
317
+ /**
318
+ * Query param:
319
+ */
237
320
  page_size?: number;
238
321
  }
239
322
 
240
323
  export interface UserDeleteParams {
241
324
  /**
242
- * Is this an external user ID?
325
+ * Header param:
326
+ */
327
+ 'X-API-Key': string;
328
+
329
+ /**
330
+ * Query param: Is this an external user ID?
243
331
  */
244
332
  is_external?: boolean;
245
333
  }
246
334
 
247
335
  export interface UserCreateBatchParams {
336
+ /**
337
+ * Body param:
338
+ */
248
339
  users: Array<UserCreateBatchParams.User>;
340
+
341
+ /**
342
+ * Header param:
343
+ */
344
+ 'X-API-Key': string;
249
345
  }
250
346
 
251
347
  export namespace UserCreateBatchParams {
@@ -263,6 +359,10 @@ export namespace UserCreateBatchParams {
263
359
  }
264
360
  }
265
361
 
362
+ export interface UserGetParams {
363
+ 'X-API-Key': string;
364
+ }
365
+
266
366
  export declare namespace User {
267
367
  export {
268
368
  type UserResponse as UserResponse,
@@ -275,5 +375,6 @@ export declare namespace User {
275
375
  type UserListParams as UserListParams,
276
376
  type UserDeleteParams as UserDeleteParams,
277
377
  type UserCreateBatchParams as UserCreateBatchParams,
378
+ type UserGetParams as UserGetParams,
278
379
  };
279
380
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.8.3'; // x-release-please-version
1
+ export const VERSION = '1.9.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.8.3";
1
+ export declare const VERSION = "1.9.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.8.3";
1
+ export declare const VERSION = "1.9.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.8.3'; // x-release-please-version
4
+ exports.VERSION = '1.9.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.8.3'; // x-release-please-version
1
+ export const VERSION = '1.9.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map