@papr/memory 1.9.0 → 1.13.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 (83) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +11 -9
  3. package/client.d.mts +23 -11
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +23 -11
  6. package/client.d.ts.map +1 -1
  7. package/client.js +41 -21
  8. package/client.js.map +1 -1
  9. package/client.mjs +41 -21
  10. package/client.mjs.map +1 -1
  11. package/internal/request-options.d.mts +42 -0
  12. package/internal/request-options.d.mts.map +1 -1
  13. package/internal/request-options.d.ts +42 -0
  14. package/internal/request-options.d.ts.map +1 -1
  15. package/internal/request-options.js.map +1 -1
  16. package/internal/request-options.mjs.map +1 -1
  17. package/internal/uploads.js +1 -1
  18. package/internal/uploads.js.map +1 -1
  19. package/internal/uploads.mjs +1 -1
  20. package/internal/uploads.mjs.map +1 -1
  21. package/internal/utils/log.d.mts.map +1 -1
  22. package/internal/utils/log.d.ts.map +1 -1
  23. package/internal/utils/log.js +4 -3
  24. package/internal/utils/log.js.map +1 -1
  25. package/internal/utils/log.mjs +4 -3
  26. package/internal/utils/log.mjs.map +1 -1
  27. package/internal/utils/path.d.mts.map +1 -1
  28. package/internal/utils/path.d.ts.map +1 -1
  29. package/internal/utils/path.js +26 -5
  30. package/internal/utils/path.js.map +1 -1
  31. package/internal/utils/path.mjs +26 -5
  32. package/internal/utils/path.mjs.map +1 -1
  33. package/package.json +1 -1
  34. package/resources/feedback.d.mts +333 -0
  35. package/resources/feedback.d.mts.map +1 -0
  36. package/resources/feedback.d.ts +333 -0
  37. package/resources/feedback.d.ts.map +1 -0
  38. package/resources/feedback.js +108 -0
  39. package/resources/feedback.js.map +1 -0
  40. package/resources/feedback.mjs +104 -0
  41. package/resources/feedback.mjs.map +1 -0
  42. package/resources/index.d.mts +2 -1
  43. package/resources/index.d.mts.map +1 -1
  44. package/resources/index.d.ts +2 -1
  45. package/resources/index.d.ts.map +1 -1
  46. package/resources/index.js +3 -1
  47. package/resources/index.js.map +1 -1
  48. package/resources/index.mjs +1 -0
  49. package/resources/index.mjs.map +1 -1
  50. package/resources/memory.d.mts +48 -11
  51. package/resources/memory.d.mts.map +1 -1
  52. package/resources/memory.d.ts +48 -11
  53. package/resources/memory.d.ts.map +1 -1
  54. package/resources/memory.js +11 -0
  55. package/resources/memory.js.map +1 -1
  56. package/resources/memory.mjs +11 -0
  57. package/resources/memory.mjs.map +1 -1
  58. package/resources/user.d.mts +24 -88
  59. package/resources/user.d.mts.map +1 -1
  60. package/resources/user.d.ts +24 -88
  61. package/resources/user.d.ts.map +1 -1
  62. package/resources/user.js +17 -56
  63. package/resources/user.js.map +1 -1
  64. package/resources/user.mjs +17 -56
  65. package/resources/user.mjs.map +1 -1
  66. package/src/client.ts +74 -28
  67. package/src/internal/request-options.ts +53 -0
  68. package/src/internal/uploads.ts +1 -1
  69. package/src/internal/utils/log.ts +3 -2
  70. package/src/internal/utils/path.ts +32 -7
  71. package/src/resources/feedback.ts +424 -0
  72. package/src/resources/index.ts +9 -1
  73. package/src/resources/memory.ts +44 -11
  74. package/src/resources/user.ts +29 -130
  75. package/src/version.ts +1 -1
  76. package/version.d.mts +1 -1
  77. package/version.d.mts.map +1 -1
  78. package/version.d.ts +1 -1
  79. package/version.d.ts.map +1 -1
  80. package/version.js +1 -1
  81. package/version.js.map +1 -1
  82. package/version.mjs +1 -1
  83. package/version.mjs.map +1 -1
@@ -3,7 +3,6 @@
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';
7
6
  import { RequestOptions } from '../internal/request-options';
8
7
  import { path } from '../internal/utils/path';
9
8
 
@@ -15,17 +14,11 @@ export class User extends APIResource {
15
14
  * ```ts
16
15
  * const userResponse = await client.user.create({
17
16
  * external_id: 'user123',
18
- * 'X-API-Key': 'X-API-Key',
19
17
  * });
20
18
  * ```
21
19
  */
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
- });
20
+ create(body: UserCreateParams, options?: RequestOptions): APIPromise<UserResponse> {
21
+ return this._client.post('/v1/user', { body, ...options });
29
22
  }
30
23
 
31
24
  /**
@@ -33,18 +26,11 @@ export class User extends APIResource {
33
26
  *
34
27
  * @example
35
28
  * ```ts
36
- * const userResponse = await client.user.update('user_id', {
37
- * 'X-API-Key': 'X-API-Key',
38
- * });
29
+ * const userResponse = await client.user.update('user_id');
39
30
  * ```
40
31
  */
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
- });
32
+ update(userID: string, body: UserUpdateParams, options?: RequestOptions): APIPromise<UserResponse> {
33
+ return this._client.put(path`/v1/user/${userID}`, { body, ...options });
48
34
  }
49
35
 
50
36
  /**
@@ -52,18 +38,14 @@ export class User extends APIResource {
52
38
  *
53
39
  * @example
54
40
  * ```ts
55
- * const users = await client.user.list({
56
- * 'X-API-Key': 'X-API-Key',
57
- * });
41
+ * const users = await client.user.list();
58
42
  * ```
59
43
  */
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
- });
44
+ list(
45
+ query: UserListParams | null | undefined = {},
46
+ options?: RequestOptions,
47
+ ): APIPromise<UserListResponse> {
48
+ return this._client.get('/v1/user', { query, ...options });
67
49
  }
68
50
 
69
51
  /**
@@ -72,18 +54,16 @@ export class User extends APIResource {
72
54
  *
73
55
  * @example
74
56
  * ```ts
75
- * const user = await client.user.delete('user_id', {
76
- * 'X-API-Key': 'X-API-Key',
77
- * });
57
+ * const user = await client.user.delete('user_id');
78
58
  * ```
79
59
  */
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
- });
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 });
87
67
  }
88
68
 
89
69
  /**
@@ -94,17 +74,11 @@ export class User extends APIResource {
94
74
  * ```ts
95
75
  * const response = await client.user.createBatch({
96
76
  * users: [{ external_id: 'user123' }],
97
- * 'X-API-Key': 'X-API-Key',
98
77
  * });
99
78
  * ```
100
79
  */
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
- });
80
+ createBatch(body: UserCreateBatchParams, options?: RequestOptions): APIPromise<UserCreateBatchResponse> {
81
+ return this._client.post('/v1/user/batch', { body, ...options });
108
82
  }
109
83
 
110
84
  /**
@@ -112,17 +86,11 @@ export class User extends APIResource {
112
86
  *
113
87
  * @example
114
88
  * ```ts
115
- * const userResponse = await client.user.get('user_id', {
116
- * 'X-API-Key': 'X-API-Key',
117
- * });
89
+ * const userResponse = await client.user.get('user_id');
118
90
  * ```
119
91
  */
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
- });
92
+ get(userID: string, options?: RequestOptions): APIPromise<UserResponse> {
93
+ return this._client.get(path`/v1/user/${userID}`, options);
126
94
  }
127
95
  }
128
96
 
@@ -150,7 +118,7 @@ export interface UserResponse {
150
118
 
151
119
  external_id?: string | null;
152
120
 
153
- metadata?: unknown | null;
121
+ metadata?: { [key: string]: unknown } | null;
154
122
 
155
123
  updated_at?: string | null;
156
124
 
@@ -240,108 +208,44 @@ export interface UserCreateBatchResponse {
240
208
  }
241
209
 
242
210
  export interface UserCreateParams {
243
- /**
244
- * Body param:
245
- */
246
211
  external_id: string;
247
212
 
248
- /**
249
- * Header param:
250
- */
251
- 'X-API-Key': string;
252
-
253
- /**
254
- * Body param:
255
- */
256
213
  email?: string | null;
257
214
 
258
- /**
259
- * Body param:
260
- */
261
- metadata?: unknown | null;
215
+ metadata?: { [key: string]: unknown } | null;
262
216
 
263
- /**
264
- * Body param:
265
- */
266
217
  type?: UserType;
267
218
  }
268
219
 
269
220
  export interface UserUpdateParams {
270
- /**
271
- * Header param:
272
- */
273
- 'X-API-Key': string;
274
-
275
- /**
276
- * Body param:
277
- */
278
221
  email?: string | null;
279
222
 
280
- /**
281
- * Body param:
282
- */
283
223
  external_id?: string | null;
284
224
 
285
- /**
286
- * Body param:
287
- */
288
- metadata?: unknown | null;
225
+ metadata?: { [key: string]: unknown } | null;
289
226
 
290
- /**
291
- * Body param:
292
- */
293
227
  type?: UserType | null;
294
228
  }
295
229
 
296
230
  export interface UserListParams {
297
- /**
298
- * Header param:
299
- */
300
- 'X-API-Key': string;
301
-
302
- /**
303
- * Query param:
304
- */
305
231
  email?: string | null;
306
232
 
307
- /**
308
- * Query param:
309
- */
310
233
  external_id?: string | null;
311
234
 
312
- /**
313
- * Query param:
314
- */
315
235
  page?: number;
316
236
 
317
- /**
318
- * Query param:
319
- */
320
237
  page_size?: number;
321
238
  }
322
239
 
323
240
  export interface UserDeleteParams {
324
241
  /**
325
- * Header param:
326
- */
327
- 'X-API-Key': string;
328
-
329
- /**
330
- * Query param: Is this an external user ID?
242
+ * Is this an external user ID?
331
243
  */
332
244
  is_external?: boolean;
333
245
  }
334
246
 
335
247
  export interface UserCreateBatchParams {
336
- /**
337
- * Body param:
338
- */
339
248
  users: Array<UserCreateBatchParams.User>;
340
-
341
- /**
342
- * Header param:
343
- */
344
- 'X-API-Key': string;
345
249
  }
346
250
 
347
251
  export namespace UserCreateBatchParams {
@@ -353,16 +257,12 @@ export namespace UserCreateBatchParams {
353
257
 
354
258
  email?: string | null;
355
259
 
356
- metadata?: unknown | null;
260
+ metadata?: { [key: string]: unknown } | null;
357
261
 
358
262
  type?: UserAPI.UserType;
359
263
  }
360
264
  }
361
265
 
362
- export interface UserGetParams {
363
- 'X-API-Key': string;
364
- }
365
-
366
266
  export declare namespace User {
367
267
  export {
368
268
  type UserResponse as UserResponse,
@@ -375,6 +275,5 @@ export declare namespace User {
375
275
  type UserListParams as UserListParams,
376
276
  type UserDeleteParams as UserDeleteParams,
377
277
  type UserCreateBatchParams as UserCreateBatchParams,
378
- type UserGetParams as UserGetParams,
379
278
  };
380
279
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.9.0'; // x-release-please-version
1
+ export const VERSION = '1.13.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.9.0";
1
+ export declare const VERSION = "1.13.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.9.0";
1
+ export declare const VERSION = "1.13.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
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.9.0'; // x-release-please-version
4
+ exports.VERSION = '1.13.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.9.0'; // x-release-please-version
1
+ export const VERSION = '1.13.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}