gumnut-sdk 0.1.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 +365 -0
- package/LICENSE +201 -0
- package/README.md +462 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +199 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +199 -0
- package/client.d.ts.map +1 -0
- package/client.js +483 -0
- package/client.js.map +1 -0
- package/client.mjs +479 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +57 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +57 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +108 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +102 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +7 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -0
- package/index.js +32 -0
- package/index.js.map +1 -0
- package/index.mjs +8 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +32 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +32 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +28 -0
- package/internal/shim-types.d.ts +28 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +67 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +67 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +58 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +53 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +16 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +16 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +109 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +92 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +149 -0
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/albums/albums.d.mts +53 -0
- package/resources/albums/albums.d.mts.map +1 -0
- package/resources/albums/albums.d.ts +53 -0
- package/resources/albums/albums.d.ts.map +1 -0
- package/resources/albums/albums.js +54 -0
- package/resources/albums/albums.js.map +1 -0
- package/resources/albums/albums.mjs +49 -0
- package/resources/albums/albums.mjs.map +1 -0
- package/resources/albums/assets.d.mts +33 -0
- package/resources/albums/assets.d.mts.map +1 -0
- package/resources/albums/assets.d.ts +33 -0
- package/resources/albums/assets.d.ts.map +1 -0
- package/resources/albums/assets.js +38 -0
- package/resources/albums/assets.js.map +1 -0
- package/resources/albums/assets.mjs +34 -0
- package/resources/albums/assets.mjs.map +1 -0
- package/resources/albums/index.d.mts +3 -0
- package/resources/albums/index.d.mts.map +1 -0
- package/resources/albums/index.d.ts +3 -0
- package/resources/albums/index.d.ts.map +1 -0
- package/resources/albums/index.js +9 -0
- package/resources/albums/index.js.map +1 -0
- package/resources/albums/index.mjs +4 -0
- package/resources/albums/index.mjs.map +1 -0
- package/resources/albums.d.mts +2 -0
- package/resources/albums.d.mts.map +1 -0
- package/resources/albums.d.ts +2 -0
- package/resources/albums.d.ts.map +1 -0
- package/resources/albums.js +6 -0
- package/resources/albums.js.map +1 -0
- package/resources/albums.mjs +3 -0
- package/resources/albums.mjs.map +1 -0
- package/resources/api-keys.d.mts +41 -0
- package/resources/api-keys.d.mts.map +1 -0
- package/resources/api-keys.d.ts +41 -0
- package/resources/api-keys.d.ts.map +1 -0
- package/resources/api-keys.js +32 -0
- package/resources/api-keys.js.map +1 -0
- package/resources/api-keys.mjs +28 -0
- package/resources/api-keys.mjs.map +1 -0
- package/resources/assets.d.mts +110 -0
- package/resources/assets.d.mts.map +1 -0
- package/resources/assets.d.ts +110 -0
- package/resources/assets.d.ts.map +1 -0
- package/resources/assets.js +66 -0
- package/resources/assets.js.map +1 -0
- package/resources/assets.mjs +62 -0
- package/resources/assets.mjs.map +1 -0
- package/resources/faces.d.mts +57 -0
- package/resources/faces.d.mts.map +1 -0
- package/resources/faces.d.ts +57 -0
- package/resources/faces.d.ts.map +1 -0
- package/resources/faces.js +52 -0
- package/resources/faces.js.map +1 -0
- package/resources/faces.mjs +48 -0
- package/resources/faces.mjs.map +1 -0
- package/resources/index.d.mts +7 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +7 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +17 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +8 -0
- package/resources/index.mjs.map +1 -0
- package/resources/people.d.mts +67 -0
- package/resources/people.d.mts.map +1 -0
- package/resources/people.d.ts +67 -0
- package/resources/people.d.ts.map +1 -0
- package/resources/people.js +46 -0
- package/resources/people.js.map +1 -0
- package/resources/people.mjs +42 -0
- package/resources/people.mjs.map +1 -0
- package/resources/search.d.mts +41 -0
- package/resources/search.d.mts.map +1 -0
- package/resources/search.d.ts +41 -0
- package/resources/search.d.ts.map +1 -0
- package/resources/search.js +15 -0
- package/resources/search.js.map +1 -0
- package/resources/search.mjs +11 -0
- package/resources/search.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +819 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/pagination.ts +169 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +23 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/request-options.ts +37 -0
- package/src/internal/shim-types.d.ts +28 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +92 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +63 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +102 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +2 -0
- package/src/resource.ts +2 -0
- package/src/resources/albums/albums.ts +110 -0
- package/src/resources/albums/assets.ts +63 -0
- package/src/resources/albums/index.ts +17 -0
- package/src/resources/albums.ts +3 -0
- package/src/resources/api-keys.ts +73 -0
- package/src/resources/assets.ts +207 -0
- package/src/resources/faces.ts +103 -0
- package/src/resources/index.ts +35 -0
- package/src/resources/people.ts +120 -0
- package/src/resources/search.ts +53 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.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,63 @@
|
|
|
1
|
+
import { GumnutError } from '../../core/error';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Percent-encode everything that isn't safe to have in a path without encoding safe chars.
|
|
5
|
+
*
|
|
6
|
+
* Taken from https://datatracker.ietf.org/doc/html/rfc3986#section-3.3:
|
|
7
|
+
* > unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
8
|
+
* > sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
|
|
9
|
+
* > pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
|
10
|
+
*/
|
|
11
|
+
export function encodeURIPath(str: string) {
|
|
12
|
+
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
|
|
16
|
+
function path(statics: readonly string[], ...params: readonly unknown[]): string {
|
|
17
|
+
// If there are no params, no processing is needed.
|
|
18
|
+
if (statics.length === 1) return statics[0]!;
|
|
19
|
+
|
|
20
|
+
let postPath = false;
|
|
21
|
+
const path = statics.reduce((previousValue, currentValue, index) => {
|
|
22
|
+
if (/[?#]/.test(currentValue)) {
|
|
23
|
+
postPath = true;
|
|
24
|
+
}
|
|
25
|
+
return (
|
|
26
|
+
previousValue +
|
|
27
|
+
currentValue +
|
|
28
|
+
(index === params.length ? '' : (postPath ? encodeURIComponent : pathEncoder)(String(params[index])))
|
|
29
|
+
);
|
|
30
|
+
}, '');
|
|
31
|
+
|
|
32
|
+
const pathOnly = path.split(/[?#]/, 1)[0]!;
|
|
33
|
+
const invalidSegments = [];
|
|
34
|
+
const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
|
|
35
|
+
let match;
|
|
36
|
+
|
|
37
|
+
// Find all invalid segments
|
|
38
|
+
while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
|
|
39
|
+
invalidSegments.push({
|
|
40
|
+
start: match.index,
|
|
41
|
+
length: match[0].length,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (invalidSegments.length > 0) {
|
|
46
|
+
let lastEnd = 0;
|
|
47
|
+
const underline = invalidSegments.reduce((acc, segment) => {
|
|
48
|
+
const spaces = ' '.repeat(segment.start - lastEnd);
|
|
49
|
+
const arrows = '^'.repeat(segment.length);
|
|
50
|
+
lastEnd = segment.start + segment.length;
|
|
51
|
+
return acc + spaces + arrows;
|
|
52
|
+
}, '');
|
|
53
|
+
|
|
54
|
+
throw new GumnutError(`Path parameters result in path with invalid segments:\n${path}\n${underline}`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return path;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
|
|
62
|
+
*/
|
|
63
|
+
export const path = createPathTagFunction(encodeURIPath);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* https://stackoverflow.com/a/2117523
|
|
5
|
+
*/
|
|
6
|
+
export let uuid4 = function () {
|
|
7
|
+
const { crypto } = globalThis as any;
|
|
8
|
+
if (crypto?.randomUUID) {
|
|
9
|
+
uuid4 = crypto.randomUUID.bind(crypto);
|
|
10
|
+
return crypto.randomUUID();
|
|
11
|
+
}
|
|
12
|
+
const u8 = new Uint8Array(1);
|
|
13
|
+
const randomByte = crypto ? () => crypto.getRandomValues(u8)[0]! : () => (Math.random() * 0xff) & 0xff;
|
|
14
|
+
return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) =>
|
|
15
|
+
(+c ^ (randomByte() & (15 >> (+c / 4)))).toString(16),
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { GumnutError } from '../../core/error';
|
|
4
|
+
|
|
5
|
+
// https://url.spec.whatwg.org/#url-scheme-string
|
|
6
|
+
const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
7
|
+
|
|
8
|
+
export const isAbsoluteURL = (url: string): boolean => {
|
|
9
|
+
return startsWithSchemeRegexp.test(url);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** Returns an object if the given value isn't an object, otherwise returns as-is */
|
|
13
|
+
export function maybeObj(x: unknown): object {
|
|
14
|
+
if (typeof x !== 'object') {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return x ?? {};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// https://stackoverflow.com/a/34491287
|
|
22
|
+
export function isEmptyObj(obj: Object | null | undefined): boolean {
|
|
23
|
+
if (!obj) return true;
|
|
24
|
+
for (const _k in obj) return false;
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// https://eslint.org/docs/latest/rules/no-prototype-builtins
|
|
29
|
+
export function hasOwn<T extends object = object>(obj: T, key: PropertyKey): key is keyof T {
|
|
30
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function isObj(obj: unknown): obj is Record<string, unknown> {
|
|
34
|
+
return obj != null && typeof obj === 'object' && !Array.isArray(obj);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const ensurePresent = <T>(value: T | null | undefined): T => {
|
|
38
|
+
if (value == null) {
|
|
39
|
+
throw new GumnutError(`Expected a value to be given but received ${value} instead.`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return value;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const validatePositiveInteger = (name: string, n: unknown): number => {
|
|
46
|
+
if (typeof n !== 'number' || !Number.isInteger(n)) {
|
|
47
|
+
throw new GumnutError(`${name} must be an integer`);
|
|
48
|
+
}
|
|
49
|
+
if (n < 0) {
|
|
50
|
+
throw new GumnutError(`${name} must be a positive integer`);
|
|
51
|
+
}
|
|
52
|
+
return n;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const coerceInteger = (value: unknown): number => {
|
|
56
|
+
if (typeof value === 'number') return Math.round(value);
|
|
57
|
+
if (typeof value === 'string') return parseInt(value, 10);
|
|
58
|
+
|
|
59
|
+
throw new GumnutError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const coerceFloat = (value: unknown): number => {
|
|
63
|
+
if (typeof value === 'number') return value;
|
|
64
|
+
if (typeof value === 'string') return parseFloat(value);
|
|
65
|
+
|
|
66
|
+
throw new GumnutError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const coerceBoolean = (value: unknown): boolean => {
|
|
70
|
+
if (typeof value === 'boolean') return value;
|
|
71
|
+
if (typeof value === 'string') return value === 'true';
|
|
72
|
+
return Boolean(value);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const maybeCoerceInteger = (value: unknown): number | undefined => {
|
|
76
|
+
if (value === undefined) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
return coerceInteger(value);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const maybeCoerceFloat = (value: unknown): number | undefined => {
|
|
83
|
+
if (value === undefined) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
return coerceFloat(value);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
|
|
90
|
+
if (value === undefined) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
return coerceBoolean(value);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const safeJSON = (text: string) => {
|
|
97
|
+
try {
|
|
98
|
+
return JSON.parse(text);
|
|
99
|
+
} catch (err) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export * from './utils/values';
|
|
4
|
+
export * from './utils/base64';
|
|
5
|
+
export * from './utils/env';
|
|
6
|
+
export * from './utils/log';
|
|
7
|
+
export * from './utils/uuid';
|
|
8
|
+
export * from './utils/sleep';
|
package/src/lib/.keep
ADDED
package/src/resource.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as AssetsAPI from './assets';
|
|
5
|
+
import {
|
|
6
|
+
AlbumAssetAssociation,
|
|
7
|
+
AssetAddParams,
|
|
8
|
+
AssetListResponse,
|
|
9
|
+
AssetRemoveParams,
|
|
10
|
+
Assets,
|
|
11
|
+
} from './assets';
|
|
12
|
+
import { APIPromise } from '../../core/api-promise';
|
|
13
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../../core/pagination';
|
|
14
|
+
import { buildHeaders } from '../../internal/headers';
|
|
15
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
16
|
+
import { path } from '../../internal/utils/path';
|
|
17
|
+
|
|
18
|
+
export class Albums extends APIResource {
|
|
19
|
+
assets: AssetsAPI.Assets = new AssetsAPI.Assets(this._client);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new, empty album with a given name and optional description.
|
|
23
|
+
*/
|
|
24
|
+
create(body: AlbumCreateParams, options?: RequestOptions): APIPromise<AlbumResponse> {
|
|
25
|
+
return this._client.post('/api/albums', { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves details for a specific album.
|
|
30
|
+
*/
|
|
31
|
+
retrieve(albumID: string, options?: RequestOptions): APIPromise<AlbumResponse> {
|
|
32
|
+
return this._client.get(path`/api/albums/${albumID}`, options);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Updates the name and/or description of a specific album.
|
|
37
|
+
*/
|
|
38
|
+
update(albumID: string, body: AlbumUpdateParams, options?: RequestOptions): APIPromise<AlbumResponse> {
|
|
39
|
+
return this._client.patch(path`/api/albums/${albumID}`, { body, ...options });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Retrieves a paginated list of albums, ordered by creation time, descending.
|
|
44
|
+
*/
|
|
45
|
+
list(
|
|
46
|
+
query: AlbumListParams | null | undefined = {},
|
|
47
|
+
options?: RequestOptions,
|
|
48
|
+
): PagePromise<AlbumResponsesCursorPage, AlbumResponse> {
|
|
49
|
+
return this._client.getAPIList('/api/albums', CursorPage<AlbumResponse>, { query, ...options });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Deletes a specific album. Note: This does not delete the assets within the
|
|
54
|
+
* album.
|
|
55
|
+
*/
|
|
56
|
+
delete(albumID: string, options?: RequestOptions): APIPromise<void> {
|
|
57
|
+
return this._client.delete(path`/api/albums/${albumID}`, {
|
|
58
|
+
...options,
|
|
59
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type AlbumResponsesCursorPage = CursorPage<AlbumResponse>;
|
|
65
|
+
|
|
66
|
+
export interface AlbumResponse {
|
|
67
|
+
id: string;
|
|
68
|
+
|
|
69
|
+
created_at: string;
|
|
70
|
+
|
|
71
|
+
name: string;
|
|
72
|
+
|
|
73
|
+
updated_at: string;
|
|
74
|
+
|
|
75
|
+
description?: string | null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface AlbumCreateParams {
|
|
79
|
+
name: string;
|
|
80
|
+
|
|
81
|
+
description?: string | null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface AlbumUpdateParams {
|
|
85
|
+
description?: string | null;
|
|
86
|
+
|
|
87
|
+
name?: string | null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface AlbumListParams extends CursorPageParams {}
|
|
91
|
+
|
|
92
|
+
Albums.Assets = Assets;
|
|
93
|
+
|
|
94
|
+
export declare namespace Albums {
|
|
95
|
+
export {
|
|
96
|
+
type AlbumResponse as AlbumResponse,
|
|
97
|
+
type AlbumResponsesCursorPage as AlbumResponsesCursorPage,
|
|
98
|
+
type AlbumCreateParams as AlbumCreateParams,
|
|
99
|
+
type AlbumUpdateParams as AlbumUpdateParams,
|
|
100
|
+
type AlbumListParams as AlbumListParams,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
Assets as Assets,
|
|
105
|
+
type AlbumAssetAssociation as AlbumAssetAssociation,
|
|
106
|
+
type AssetListResponse as AssetListResponse,
|
|
107
|
+
type AssetAddParams as AssetAddParams,
|
|
108
|
+
type AssetRemoveParams as AssetRemoveParams,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as AssetsAPI from '../assets';
|
|
5
|
+
import { APIPromise } from '../../core/api-promise';
|
|
6
|
+
import { buildHeaders } from '../../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
8
|
+
import { path } from '../../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class Assets extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves a list of all assets contained within a specific album.
|
|
13
|
+
*/
|
|
14
|
+
list(albumID: string, options?: RequestOptions): APIPromise<AssetListResponse> {
|
|
15
|
+
return this._client.get(path`/api/albums/${albumID}/assets`, options);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Adds one or more existing assets to a specific album.
|
|
20
|
+
*/
|
|
21
|
+
add(albumID: string, body: AssetAddParams, options?: RequestOptions): APIPromise<void> {
|
|
22
|
+
return this._client.post(path`/api/albums/${albumID}/assets`, {
|
|
23
|
+
body,
|
|
24
|
+
...options,
|
|
25
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Removes one or more assets from a specific album. Note: This does not delete the
|
|
31
|
+
* assets themselves.
|
|
32
|
+
*/
|
|
33
|
+
remove(albumID: string, body: AssetRemoveParams, options?: RequestOptions): APIPromise<void> {
|
|
34
|
+
return this._client.delete(path`/api/albums/${albumID}/assets`, {
|
|
35
|
+
body,
|
|
36
|
+
...options,
|
|
37
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface AlbumAssetAssociation {
|
|
43
|
+
asset_ids: Array<string>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type AssetListResponse = Array<AssetsAPI.AssetResponse>;
|
|
47
|
+
|
|
48
|
+
export interface AssetAddParams {
|
|
49
|
+
asset_ids: Array<string>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface AssetRemoveParams {
|
|
53
|
+
asset_ids: Array<string>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export declare namespace Assets {
|
|
57
|
+
export {
|
|
58
|
+
type AlbumAssetAssociation as AlbumAssetAssociation,
|
|
59
|
+
type AssetListResponse as AssetListResponse,
|
|
60
|
+
type AssetAddParams as AssetAddParams,
|
|
61
|
+
type AssetRemoveParams as AssetRemoveParams,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Albums,
|
|
5
|
+
type AlbumResponse,
|
|
6
|
+
type AlbumCreateParams,
|
|
7
|
+
type AlbumUpdateParams,
|
|
8
|
+
type AlbumListParams,
|
|
9
|
+
type AlbumResponsesCursorPage,
|
|
10
|
+
} from './albums';
|
|
11
|
+
export {
|
|
12
|
+
Assets,
|
|
13
|
+
type AlbumAssetAssociation,
|
|
14
|
+
type AssetListResponse,
|
|
15
|
+
type AssetAddParams,
|
|
16
|
+
type AssetRemoveParams,
|
|
17
|
+
} from './assets';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class APIKeys extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new API key for the current user
|
|
12
|
+
*/
|
|
13
|
+
create(options?: RequestOptions): APIPromise<APIKeyCreateResponse> {
|
|
14
|
+
return this._client.post('/api-keys/', options);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves a list of all API keys for the current user
|
|
19
|
+
*/
|
|
20
|
+
list(options?: RequestOptions): APIPromise<APIKeyListResponse> {
|
|
21
|
+
return this._client.get('/api-keys/', options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Deletes a specific API key
|
|
26
|
+
*/
|
|
27
|
+
delete(keyID: string, options?: RequestOptions): APIPromise<void> {
|
|
28
|
+
return this._client.delete(path`/api-keys/${keyID}`, {
|
|
29
|
+
...options,
|
|
30
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface APIKeyResponse {
|
|
36
|
+
id: string;
|
|
37
|
+
|
|
38
|
+
created_at: string;
|
|
39
|
+
|
|
40
|
+
is_active: boolean;
|
|
41
|
+
|
|
42
|
+
last_used_at: string | null;
|
|
43
|
+
|
|
44
|
+
name: string | null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The only difference between this and APIKeyResponse is that it includes the full
|
|
49
|
+
* API key.
|
|
50
|
+
*/
|
|
51
|
+
export interface APIKeyCreateResponse {
|
|
52
|
+
id: string;
|
|
53
|
+
|
|
54
|
+
api_key: string;
|
|
55
|
+
|
|
56
|
+
created_at: string;
|
|
57
|
+
|
|
58
|
+
is_active: boolean;
|
|
59
|
+
|
|
60
|
+
last_used_at: string | null;
|
|
61
|
+
|
|
62
|
+
name: string | null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type APIKeyListResponse = Array<APIKeyResponse>;
|
|
66
|
+
|
|
67
|
+
export declare namespace APIKeys {
|
|
68
|
+
export {
|
|
69
|
+
type APIKeyResponse as APIKeyResponse,
|
|
70
|
+
type APIKeyCreateResponse as APIKeyCreateResponse,
|
|
71
|
+
type APIKeyListResponse as APIKeyListResponse,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
|
|
6
|
+
import { type Uploadable } from '../core/uploads';
|
|
7
|
+
import { buildHeaders } from '../internal/headers';
|
|
8
|
+
import { RequestOptions } from '../internal/request-options';
|
|
9
|
+
import { multipartFormRequestOptions } from '../internal/uploads';
|
|
10
|
+
import { path } from '../internal/utils/path';
|
|
11
|
+
|
|
12
|
+
export class Assets extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Uploads a new asset file (image or video) along with its metadata. If an asset
|
|
15
|
+
* with the same checksum already exists, returns the existing asset's metadata.
|
|
16
|
+
*/
|
|
17
|
+
create(body: AssetCreateParams, options?: RequestOptions): APIPromise<AssetResponse> {
|
|
18
|
+
return this._client.post('/api/assets', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves detailed metadata for a specific asset, including EXIF information and
|
|
23
|
+
* asset metrics.
|
|
24
|
+
*/
|
|
25
|
+
retrieve(assetID: string, options?: RequestOptions): APIPromise<AssetResponse> {
|
|
26
|
+
return this._client.get(path`/api/assets/${assetID}`, options);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves a paginated list of assets, optionally filtered by album. Assets are
|
|
31
|
+
* ordered by local creation time, descending.
|
|
32
|
+
*/
|
|
33
|
+
list(
|
|
34
|
+
query: AssetListParams | null | undefined = {},
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): PagePromise<AssetResponsesCursorPage, AssetResponse> {
|
|
37
|
+
return this._client.getAPIList('/api/assets', CursorPage<AssetResponse>, { query, ...options });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Deletes a specific asset and its associated data (including the file from
|
|
42
|
+
* storage).
|
|
43
|
+
*/
|
|
44
|
+
delete(assetID: string, options?: RequestOptions): APIPromise<void> {
|
|
45
|
+
return this._client.delete(path`/api/assets/${assetID}`, {
|
|
46
|
+
...options,
|
|
47
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Downloads the original file for a specific asset.
|
|
53
|
+
*/
|
|
54
|
+
download(assetID: string, options?: RequestOptions): APIPromise<Response> {
|
|
55
|
+
return this._client.get(path`/api/assets/${assetID}/download`, {
|
|
56
|
+
...options,
|
|
57
|
+
headers: buildHeaders([{ Accept: 'image/*' }, options?.headers]),
|
|
58
|
+
__binaryResponse: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Downloads a thumbnail for a specific asset. The exact thumbnail returned depends
|
|
64
|
+
* on availability and the optional `size` parameter.
|
|
65
|
+
*/
|
|
66
|
+
downloadThumbnail(
|
|
67
|
+
assetID: string,
|
|
68
|
+
query: AssetDownloadThumbnailParams | null | undefined = {},
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): APIPromise<Response> {
|
|
71
|
+
return this._client.get(path`/api/assets/${assetID}/thumbnail`, {
|
|
72
|
+
query,
|
|
73
|
+
...options,
|
|
74
|
+
headers: buildHeaders([{ Accept: 'image/*' }, options?.headers]),
|
|
75
|
+
__binaryResponse: true,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type AssetResponsesCursorPage = CursorPage<AssetResponse>;
|
|
81
|
+
|
|
82
|
+
export interface AssetResponse {
|
|
83
|
+
id: string;
|
|
84
|
+
|
|
85
|
+
checksum: string;
|
|
86
|
+
|
|
87
|
+
created_at: string;
|
|
88
|
+
|
|
89
|
+
device_asset_id: string;
|
|
90
|
+
|
|
91
|
+
device_id: string;
|
|
92
|
+
|
|
93
|
+
file_created_at: string;
|
|
94
|
+
|
|
95
|
+
file_modified_at: string;
|
|
96
|
+
|
|
97
|
+
local_datetime: string;
|
|
98
|
+
|
|
99
|
+
mime_type: string;
|
|
100
|
+
|
|
101
|
+
original_file_name: string;
|
|
102
|
+
|
|
103
|
+
updated_at: string;
|
|
104
|
+
|
|
105
|
+
download_url?: string | null;
|
|
106
|
+
|
|
107
|
+
exif?: AssetResponse.Exif | null;
|
|
108
|
+
|
|
109
|
+
metrics?: Record<string, number | null> | null;
|
|
110
|
+
|
|
111
|
+
thumbnail_url?: string | null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export namespace AssetResponse {
|
|
115
|
+
export interface Exif {
|
|
116
|
+
altitude?: number | null;
|
|
117
|
+
|
|
118
|
+
auto_stack_id?: string | null;
|
|
119
|
+
|
|
120
|
+
city?: string | null;
|
|
121
|
+
|
|
122
|
+
country?: string | null;
|
|
123
|
+
|
|
124
|
+
description?: string | null;
|
|
125
|
+
|
|
126
|
+
digitized_datetime?: string | null;
|
|
127
|
+
|
|
128
|
+
exposure_bias?: number | null;
|
|
129
|
+
|
|
130
|
+
exposure_time?: number | null;
|
|
131
|
+
|
|
132
|
+
f_number?: number | null;
|
|
133
|
+
|
|
134
|
+
focal_length?: number | null;
|
|
135
|
+
|
|
136
|
+
fps?: number | null;
|
|
137
|
+
|
|
138
|
+
iso?: number | null;
|
|
139
|
+
|
|
140
|
+
latitude?: number | null;
|
|
141
|
+
|
|
142
|
+
lens_model?: string | null;
|
|
143
|
+
|
|
144
|
+
live_photo_cid?: string | null;
|
|
145
|
+
|
|
146
|
+
longitude?: number | null;
|
|
147
|
+
|
|
148
|
+
make?: string | null;
|
|
149
|
+
|
|
150
|
+
model?: string | null;
|
|
151
|
+
|
|
152
|
+
modified_datetime?: string | null;
|
|
153
|
+
|
|
154
|
+
orientation?: number | null;
|
|
155
|
+
|
|
156
|
+
original_datetime?: string | null;
|
|
157
|
+
|
|
158
|
+
profile_description?: string | null;
|
|
159
|
+
|
|
160
|
+
projection_type?: string | null;
|
|
161
|
+
|
|
162
|
+
rating?: number | null;
|
|
163
|
+
|
|
164
|
+
state?: string | null;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface AssetCreateParams {
|
|
169
|
+
asset_data: Uploadable;
|
|
170
|
+
|
|
171
|
+
device_asset_id: string;
|
|
172
|
+
|
|
173
|
+
device_id: string;
|
|
174
|
+
|
|
175
|
+
file_created_at: string;
|
|
176
|
+
|
|
177
|
+
file_modified_at: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface AssetListParams extends CursorPageParams {
|
|
181
|
+
/**
|
|
182
|
+
* Filter by assets in a specific album
|
|
183
|
+
*/
|
|
184
|
+
album_id?: string | null;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Filter by assets associated with a specific person ID
|
|
188
|
+
*/
|
|
189
|
+
person_id?: string | null;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface AssetDownloadThumbnailParams {
|
|
193
|
+
/**
|
|
194
|
+
* Desired thumbnail size (e.g., thumbnail, preview)
|
|
195
|
+
*/
|
|
196
|
+
size?: string | null;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export declare namespace Assets {
|
|
200
|
+
export {
|
|
201
|
+
type AssetResponse as AssetResponse,
|
|
202
|
+
type AssetResponsesCursorPage as AssetResponsesCursorPage,
|
|
203
|
+
type AssetCreateParams as AssetCreateParams,
|
|
204
|
+
type AssetListParams as AssetListParams,
|
|
205
|
+
type AssetDownloadThumbnailParams as AssetDownloadThumbnailParams,
|
|
206
|
+
};
|
|
207
|
+
}
|