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,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.safeJSON = exports.maybeCoerceBoolean = exports.maybeCoerceFloat = exports.maybeCoerceInteger = exports.coerceBoolean = exports.coerceFloat = exports.coerceInteger = exports.validatePositiveInteger = exports.ensurePresent = exports.isAbsoluteURL = void 0;
|
|
5
|
+
exports.maybeObj = maybeObj;
|
|
6
|
+
exports.isEmptyObj = isEmptyObj;
|
|
7
|
+
exports.hasOwn = hasOwn;
|
|
8
|
+
exports.isObj = isObj;
|
|
9
|
+
const error_1 = require("../../core/error.js");
|
|
10
|
+
// https://url.spec.whatwg.org/#url-scheme-string
|
|
11
|
+
const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
12
|
+
const isAbsoluteURL = (url) => {
|
|
13
|
+
return startsWithSchemeRegexp.test(url);
|
|
14
|
+
};
|
|
15
|
+
exports.isAbsoluteURL = isAbsoluteURL;
|
|
16
|
+
/** Returns an object if the given value isn't an object, otherwise returns as-is */
|
|
17
|
+
function maybeObj(x) {
|
|
18
|
+
if (typeof x !== 'object') {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
return x ?? {};
|
|
22
|
+
}
|
|
23
|
+
// https://stackoverflow.com/a/34491287
|
|
24
|
+
function isEmptyObj(obj) {
|
|
25
|
+
if (!obj)
|
|
26
|
+
return true;
|
|
27
|
+
for (const _k in obj)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
// https://eslint.org/docs/latest/rules/no-prototype-builtins
|
|
32
|
+
function hasOwn(obj, key) {
|
|
33
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
34
|
+
}
|
|
35
|
+
function isObj(obj) {
|
|
36
|
+
return obj != null && typeof obj === 'object' && !Array.isArray(obj);
|
|
37
|
+
}
|
|
38
|
+
const ensurePresent = (value) => {
|
|
39
|
+
if (value == null) {
|
|
40
|
+
throw new error_1.GumnutError(`Expected a value to be given but received ${value} instead.`);
|
|
41
|
+
}
|
|
42
|
+
return value;
|
|
43
|
+
};
|
|
44
|
+
exports.ensurePresent = ensurePresent;
|
|
45
|
+
const validatePositiveInteger = (name, n) => {
|
|
46
|
+
if (typeof n !== 'number' || !Number.isInteger(n)) {
|
|
47
|
+
throw new error_1.GumnutError(`${name} must be an integer`);
|
|
48
|
+
}
|
|
49
|
+
if (n < 0) {
|
|
50
|
+
throw new error_1.GumnutError(`${name} must be a positive integer`);
|
|
51
|
+
}
|
|
52
|
+
return n;
|
|
53
|
+
};
|
|
54
|
+
exports.validatePositiveInteger = validatePositiveInteger;
|
|
55
|
+
const coerceInteger = (value) => {
|
|
56
|
+
if (typeof value === 'number')
|
|
57
|
+
return Math.round(value);
|
|
58
|
+
if (typeof value === 'string')
|
|
59
|
+
return parseInt(value, 10);
|
|
60
|
+
throw new error_1.GumnutError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
61
|
+
};
|
|
62
|
+
exports.coerceInteger = coerceInteger;
|
|
63
|
+
const coerceFloat = (value) => {
|
|
64
|
+
if (typeof value === 'number')
|
|
65
|
+
return value;
|
|
66
|
+
if (typeof value === 'string')
|
|
67
|
+
return parseFloat(value);
|
|
68
|
+
throw new error_1.GumnutError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
69
|
+
};
|
|
70
|
+
exports.coerceFloat = coerceFloat;
|
|
71
|
+
const coerceBoolean = (value) => {
|
|
72
|
+
if (typeof value === 'boolean')
|
|
73
|
+
return value;
|
|
74
|
+
if (typeof value === 'string')
|
|
75
|
+
return value === 'true';
|
|
76
|
+
return Boolean(value);
|
|
77
|
+
};
|
|
78
|
+
exports.coerceBoolean = coerceBoolean;
|
|
79
|
+
const maybeCoerceInteger = (value) => {
|
|
80
|
+
if (value === undefined) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
return (0, exports.coerceInteger)(value);
|
|
84
|
+
};
|
|
85
|
+
exports.maybeCoerceInteger = maybeCoerceInteger;
|
|
86
|
+
const maybeCoerceFloat = (value) => {
|
|
87
|
+
if (value === undefined) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
return (0, exports.coerceFloat)(value);
|
|
91
|
+
};
|
|
92
|
+
exports.maybeCoerceFloat = maybeCoerceFloat;
|
|
93
|
+
const maybeCoerceBoolean = (value) => {
|
|
94
|
+
if (value === undefined) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
return (0, exports.coerceBoolean)(value);
|
|
98
|
+
};
|
|
99
|
+
exports.maybeCoerceBoolean = maybeCoerceBoolean;
|
|
100
|
+
const safeJSON = (text) => {
|
|
101
|
+
try {
|
|
102
|
+
return JSON.parse(text);
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
exports.safeJSON = safeJSON;
|
|
109
|
+
//# sourceMappingURL=values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../src/internal/utils/values.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAYtF,4BAMC;AAGD,gCAIC;AAGD,wBAEC;AAED,sBAEC;AAhCD,+CAA+C;AAE/C,iDAAiD;AACjD,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AAE/C,MAAM,aAAa,GAAG,CAAC,GAAW,EAAW,EAAE;IACpD,OAAO,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1C,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEF,oFAAoF;AACpF,SAAgB,QAAQ,CAAC,CAAU;IACjC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC;AAED,uCAAuC;AACvC,SAAgB,UAAU,CAAC,GAA8B;IACvD,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,KAAK,MAAM,EAAE,IAAI,GAAG;QAAE,OAAO,KAAK,CAAC;IACnC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,6DAA6D;AAC7D,SAAgB,MAAM,CAA4B,GAAM,EAAE,GAAgB;IACxE,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AAED,SAAgB,KAAK,CAAC,GAAY;IAChC,OAAO,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACvE,CAAC;AAEM,M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AAC;AACH,CAAC,CAAC;AANW,QAAA,QAAQ,YAMnB"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { GumnutError } from "../../core/error.mjs";
|
|
3
|
+
// https://url.spec.whatwg.org/#url-scheme-string
|
|
4
|
+
const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
5
|
+
export const isAbsoluteURL = (url) => {
|
|
6
|
+
return startsWithSchemeRegexp.test(url);
|
|
7
|
+
};
|
|
8
|
+
/** Returns an object if the given value isn't an object, otherwise returns as-is */
|
|
9
|
+
export function maybeObj(x) {
|
|
10
|
+
if (typeof x !== 'object') {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
return x ?? {};
|
|
14
|
+
}
|
|
15
|
+
// https://stackoverflow.com/a/34491287
|
|
16
|
+
export function isEmptyObj(obj) {
|
|
17
|
+
if (!obj)
|
|
18
|
+
return true;
|
|
19
|
+
for (const _k in obj)
|
|
20
|
+
return false;
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
// https://eslint.org/docs/latest/rules/no-prototype-builtins
|
|
24
|
+
export function hasOwn(obj, key) {
|
|
25
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
26
|
+
}
|
|
27
|
+
export function isObj(obj) {
|
|
28
|
+
return obj != null && typeof obj === 'object' && !Array.isArray(obj);
|
|
29
|
+
}
|
|
30
|
+
export const ensurePresent = (value) => {
|
|
31
|
+
if (value == null) {
|
|
32
|
+
throw new GumnutError(`Expected a value to be given but received ${value} instead.`);
|
|
33
|
+
}
|
|
34
|
+
return value;
|
|
35
|
+
};
|
|
36
|
+
export const validatePositiveInteger = (name, n) => {
|
|
37
|
+
if (typeof n !== 'number' || !Number.isInteger(n)) {
|
|
38
|
+
throw new GumnutError(`${name} must be an integer`);
|
|
39
|
+
}
|
|
40
|
+
if (n < 0) {
|
|
41
|
+
throw new GumnutError(`${name} must be a positive integer`);
|
|
42
|
+
}
|
|
43
|
+
return n;
|
|
44
|
+
};
|
|
45
|
+
export const coerceInteger = (value) => {
|
|
46
|
+
if (typeof value === 'number')
|
|
47
|
+
return Math.round(value);
|
|
48
|
+
if (typeof value === 'string')
|
|
49
|
+
return parseInt(value, 10);
|
|
50
|
+
throw new GumnutError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
51
|
+
};
|
|
52
|
+
export const coerceFloat = (value) => {
|
|
53
|
+
if (typeof value === 'number')
|
|
54
|
+
return value;
|
|
55
|
+
if (typeof value === 'string')
|
|
56
|
+
return parseFloat(value);
|
|
57
|
+
throw new GumnutError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
58
|
+
};
|
|
59
|
+
export const coerceBoolean = (value) => {
|
|
60
|
+
if (typeof value === 'boolean')
|
|
61
|
+
return value;
|
|
62
|
+
if (typeof value === 'string')
|
|
63
|
+
return value === 'true';
|
|
64
|
+
return Boolean(value);
|
|
65
|
+
};
|
|
66
|
+
export const maybeCoerceInteger = (value) => {
|
|
67
|
+
if (value === undefined) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
return coerceInteger(value);
|
|
71
|
+
};
|
|
72
|
+
export const maybeCoerceFloat = (value) => {
|
|
73
|
+
if (value === undefined) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
return coerceFloat(value);
|
|
77
|
+
};
|
|
78
|
+
export const maybeCoerceBoolean = (value) => {
|
|
79
|
+
if (value === undefined) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
return coerceBoolean(value);
|
|
83
|
+
};
|
|
84
|
+
export const safeJSON = (text) => {
|
|
85
|
+
try {
|
|
86
|
+
return JSON.parse(text);
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=values.mjs.map
|
|
@@ -0,0 +1 @@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AO,KAAK,KAAK,MAAM,CAAC;IACvD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAsB,EAAE;IACvE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAc,EAAsB,EAAE;IACrE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAc,EAAuB,EAAE;IACxE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE;IACvC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.mts","sourceRoot":"","sources":["../src/internal/utils.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/internal/utils.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("./tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./utils/values.js"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./utils/base64.js"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./utils/env.js"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./utils/log.js"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./utils/uuid.js"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./utils/sleep.js"), exports);
|
|
11
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/internal/utils.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAA+B;AAC/B,4DAA+B;AAC/B,yDAA4B;AAC5B,yDAA4B;AAC5B,0DAA6B;AAC7B,2DAA8B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
export * from "./utils/values.mjs";
|
|
3
|
+
export * from "./utils/base64.mjs";
|
|
4
|
+
export * from "./utils/env.mjs";
|
|
5
|
+
export * from "./utils/log.mjs";
|
|
6
|
+
export * from "./utils/uuid.mjs";
|
|
7
|
+
export * from "./utils/sleep.mjs";
|
|
8
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","sourceRoot":"","sources":["../src/internal/utils.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gumnut-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The official TypeScript library for the Gumnut API",
|
|
5
|
+
"author": "Gumnut <tedmao@gmail.com>",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"type": "commonjs",
|
|
9
|
+
"repository": "github:gumnut-ai/photos-sdk-typescript",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"packageManager": "yarn@1.22.22",
|
|
12
|
+
"files": [
|
|
13
|
+
"**/*"
|
|
14
|
+
],
|
|
15
|
+
"private": false,
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "./scripts/test",
|
|
18
|
+
"build": "./scripts/build",
|
|
19
|
+
"format": "./scripts/format",
|
|
20
|
+
"tsn": "ts-node -r tsconfig-paths/register",
|
|
21
|
+
"lint": "./scripts/lint",
|
|
22
|
+
"fix": "./scripts/format"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {},
|
|
25
|
+
"imports": {
|
|
26
|
+
"gumnut-sdk": ".",
|
|
27
|
+
"gumnut-sdk/*": "./src/*"
|
|
28
|
+
},
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"require": {
|
|
32
|
+
"types": "./index.d.ts",
|
|
33
|
+
"default": "./index.js"
|
|
34
|
+
},
|
|
35
|
+
"types": "./index.d.mts",
|
|
36
|
+
"default": "./index.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./api-promise": {
|
|
39
|
+
"import": "./api-promise.mjs",
|
|
40
|
+
"require": "./api-promise.js"
|
|
41
|
+
},
|
|
42
|
+
"./api-promise.js": {
|
|
43
|
+
"default": "./api-promise.js"
|
|
44
|
+
},
|
|
45
|
+
"./api-promise.mjs": {
|
|
46
|
+
"default": "./api-promise.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./client": {
|
|
49
|
+
"import": "./client.mjs",
|
|
50
|
+
"require": "./client.js"
|
|
51
|
+
},
|
|
52
|
+
"./client.js": {
|
|
53
|
+
"default": "./client.js"
|
|
54
|
+
},
|
|
55
|
+
"./client.mjs": {
|
|
56
|
+
"default": "./client.mjs"
|
|
57
|
+
},
|
|
58
|
+
"./core/*.mjs": {
|
|
59
|
+
"default": "./core/*.mjs"
|
|
60
|
+
},
|
|
61
|
+
"./core/*.js": {
|
|
62
|
+
"default": "./core/*.js"
|
|
63
|
+
},
|
|
64
|
+
"./core/*": {
|
|
65
|
+
"import": "./core/*.mjs",
|
|
66
|
+
"require": "./core/*.js"
|
|
67
|
+
},
|
|
68
|
+
"./error": {
|
|
69
|
+
"import": "./error.mjs",
|
|
70
|
+
"require": "./error.js"
|
|
71
|
+
},
|
|
72
|
+
"./error.js": {
|
|
73
|
+
"default": "./error.js"
|
|
74
|
+
},
|
|
75
|
+
"./error.mjs": {
|
|
76
|
+
"default": "./error.mjs"
|
|
77
|
+
},
|
|
78
|
+
"./index": {
|
|
79
|
+
"import": "./index.mjs",
|
|
80
|
+
"require": "./index.js"
|
|
81
|
+
},
|
|
82
|
+
"./index.js": {
|
|
83
|
+
"default": "./index.js"
|
|
84
|
+
},
|
|
85
|
+
"./index.mjs": {
|
|
86
|
+
"default": "./index.mjs"
|
|
87
|
+
},
|
|
88
|
+
"./pagination": {
|
|
89
|
+
"import": "./pagination.mjs",
|
|
90
|
+
"require": "./pagination.js"
|
|
91
|
+
},
|
|
92
|
+
"./pagination.js": {
|
|
93
|
+
"default": "./pagination.js"
|
|
94
|
+
},
|
|
95
|
+
"./pagination.mjs": {
|
|
96
|
+
"default": "./pagination.mjs"
|
|
97
|
+
},
|
|
98
|
+
"./resource": {
|
|
99
|
+
"import": "./resource.mjs",
|
|
100
|
+
"require": "./resource.js"
|
|
101
|
+
},
|
|
102
|
+
"./resource.js": {
|
|
103
|
+
"default": "./resource.js"
|
|
104
|
+
},
|
|
105
|
+
"./resource.mjs": {
|
|
106
|
+
"default": "./resource.mjs"
|
|
107
|
+
},
|
|
108
|
+
"./resources/*.mjs": {
|
|
109
|
+
"default": "./resources/*.mjs"
|
|
110
|
+
},
|
|
111
|
+
"./resources/*.js": {
|
|
112
|
+
"default": "./resources/*.js"
|
|
113
|
+
},
|
|
114
|
+
"./resources/*": {
|
|
115
|
+
"import": "./resources/*.mjs",
|
|
116
|
+
"require": "./resources/*.js"
|
|
117
|
+
},
|
|
118
|
+
"./resources": {
|
|
119
|
+
"import": "./resources.mjs",
|
|
120
|
+
"require": "./resources.js"
|
|
121
|
+
},
|
|
122
|
+
"./resources.js": {
|
|
123
|
+
"default": "./resources.js"
|
|
124
|
+
},
|
|
125
|
+
"./resources.mjs": {
|
|
126
|
+
"default": "./resources.mjs"
|
|
127
|
+
},
|
|
128
|
+
"./uploads": {
|
|
129
|
+
"import": "./uploads.mjs",
|
|
130
|
+
"require": "./uploads.js"
|
|
131
|
+
},
|
|
132
|
+
"./uploads.js": {
|
|
133
|
+
"default": "./uploads.js"
|
|
134
|
+
},
|
|
135
|
+
"./uploads.mjs": {
|
|
136
|
+
"default": "./uploads.mjs"
|
|
137
|
+
},
|
|
138
|
+
"./version": {
|
|
139
|
+
"import": "./version.mjs",
|
|
140
|
+
"require": "./version.js"
|
|
141
|
+
},
|
|
142
|
+
"./version.js": {
|
|
143
|
+
"default": "./version.js"
|
|
144
|
+
},
|
|
145
|
+
"./version.mjs": {
|
|
146
|
+
"default": "./version.mjs"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
package/pagination.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.mts","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":""}
|
package/pagination.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":""}
|
package/pagination.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("./internal/tslib.js");
|
|
4
|
+
/** @deprecated Import from ./core/pagination instead */
|
|
5
|
+
tslib_1.__exportStar(require("./core/pagination.js"), exports);
|
|
6
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":";;;AAAA,wDAAwD;AACxD,+DAAkC"}
|
package/pagination.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.mjs","sourceRoot":"","sources":["src/pagination.ts"],"names":[],"mappings":""}
|
package/resource.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.mts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":""}
|
package/resource.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":""}
|
package/resource.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("./internal/tslib.js");
|
|
4
|
+
/** @deprecated Import from ./core/resource instead */
|
|
5
|
+
tslib_1.__exportStar(require("./core/resource.js"), exports);
|
|
6
|
+
//# sourceMappingURL=resource.js.map
|
package/resource.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":";;;AAAA,sDAAsD;AACtD,6DAAgC"}
|
package/resource.mjs
ADDED
package/resource.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.mjs","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as AssetsAPI from "./assets.mjs";
|
|
3
|
+
import { AlbumAssetAssociation, AssetAddParams, AssetListResponse, AssetRemoveParams, Assets } from "./assets.mjs";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
5
|
+
import { CursorPage, type CursorPageParams, PagePromise } from "../../core/pagination.mjs";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
7
|
+
export declare class Albums extends APIResource {
|
|
8
|
+
assets: AssetsAPI.Assets;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new, empty album with a given name and optional description.
|
|
11
|
+
*/
|
|
12
|
+
create(body: AlbumCreateParams, options?: RequestOptions): APIPromise<AlbumResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Retrieves details for a specific album.
|
|
15
|
+
*/
|
|
16
|
+
retrieve(albumID: string, options?: RequestOptions): APIPromise<AlbumResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Updates the name and/or description of a specific album.
|
|
19
|
+
*/
|
|
20
|
+
update(albumID: string, body: AlbumUpdateParams, options?: RequestOptions): APIPromise<AlbumResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a paginated list of albums, ordered by creation time, descending.
|
|
23
|
+
*/
|
|
24
|
+
list(query?: AlbumListParams | null | undefined, options?: RequestOptions): PagePromise<AlbumResponsesCursorPage, AlbumResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Deletes a specific album. Note: This does not delete the assets within the
|
|
27
|
+
* album.
|
|
28
|
+
*/
|
|
29
|
+
delete(albumID: string, options?: RequestOptions): APIPromise<void>;
|
|
30
|
+
}
|
|
31
|
+
export type AlbumResponsesCursorPage = CursorPage<AlbumResponse>;
|
|
32
|
+
export interface AlbumResponse {
|
|
33
|
+
id: string;
|
|
34
|
+
created_at: string;
|
|
35
|
+
name: string;
|
|
36
|
+
updated_at: string;
|
|
37
|
+
description?: string | null;
|
|
38
|
+
}
|
|
39
|
+
export interface AlbumCreateParams {
|
|
40
|
+
name: string;
|
|
41
|
+
description?: string | null;
|
|
42
|
+
}
|
|
43
|
+
export interface AlbumUpdateParams {
|
|
44
|
+
description?: string | null;
|
|
45
|
+
name?: string | null;
|
|
46
|
+
}
|
|
47
|
+
export interface AlbumListParams extends CursorPageParams {
|
|
48
|
+
}
|
|
49
|
+
export declare namespace Albums {
|
|
50
|
+
export { type AlbumResponse as AlbumResponse, type AlbumResponsesCursorPage as AlbumResponsesCursorPage, type AlbumCreateParams as AlbumCreateParams, type AlbumUpdateParams as AlbumUpdateParams, type AlbumListParams as AlbumListParams, };
|
|
51
|
+
export { Assets as Assets, type AlbumAssetAssociation as AlbumAssetAssociation, type AssetListResponse as AssetListResponse, type AssetAddParams as AssetAddParams, type AssetRemoveParams as AssetRemoveParams, };
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=albums.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"albums.d.mts","sourceRoot":"","sources":["../../src/resources/albums/albums.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EACL,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACP;OACM,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAElD,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAE9D;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIpF;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAI9E;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIrG;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,E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API from "./assets.js";
|
|
3
|
+
import { AlbumAssetAssociation, AssetAddParams, AssetListResponse, AssetRemoveParams, Assets } from "./assets.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { CursorPage, type CursorPageParams, PagePromise } from "../../core/pagination.js";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
7
|
+
export declare class Albums extends APIResource {
|
|
8
|
+
assets: AssetsAPI.Assets;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new, empty album with a given name and optional description.
|
|
11
|
+
*/
|
|
12
|
+
create(body: AlbumCreateParams, options?: RequestOptions): APIPromise<AlbumResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Retrieves details for a specific album.
|
|
15
|
+
*/
|
|
16
|
+
retrieve(albumID: string, options?: RequestOptions): APIPromise<AlbumResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Updates the name and/or description of a specific album.
|
|
19
|
+
*/
|
|
20
|
+
update(albumID: string, body: AlbumUpdateParams, options?: RequestOptions): APIPromise<AlbumResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a paginated list of albums, ordered by creation time, descending.
|
|
23
|
+
*/
|
|
24
|
+
list(query?: AlbumListParams | null | undefined, options?: RequestOptions): PagePromise<AlbumResponsesCursorPage, AlbumResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Deletes a specific album. Note: This does not delete the assets within the
|
|
27
|
+
* album.
|
|
28
|
+
*/
|
|
29
|
+
delete(albumID: string, options?: RequestOptions): APIPromise<void>;
|
|
30
|
+
}
|
|
31
|
+
export type AlbumResponsesCursorPage = CursorPage<AlbumResponse>;
|
|
32
|
+
export interface AlbumResponse {
|
|
33
|
+
id: string;
|
|
34
|
+
created_at: string;
|
|
35
|
+
name: string;
|
|
36
|
+
updated_at: string;
|
|
37
|
+
description?: string | null;
|
|
38
|
+
}
|
|
39
|
+
export interface AlbumCreateParams {
|
|
40
|
+
name: string;
|
|
41
|
+
description?: string | null;
|
|
42
|
+
}
|
|
43
|
+
export interface AlbumUpdateParams {
|
|
44
|
+
description?: string | null;
|
|
45
|
+
name?: string | null;
|
|
46
|
+
}
|
|
47
|
+
export interface AlbumListParams extends CursorPageParams {
|
|
48
|
+
}
|
|
49
|
+
export declare namespace Albums {
|
|
50
|
+
export { type AlbumResponse as AlbumResponse, type AlbumResponsesCursorPage as AlbumResponsesCursorPage, type AlbumCreateParams as AlbumCreateParams, type AlbumUpdateParams as AlbumUpdateParams, type AlbumListParams as AlbumListParams, };
|
|
51
|
+
export { Assets as Assets, type AlbumAssetAssociation as AlbumAssetAssociation, type AssetListResponse as AssetListResponse, type AssetAddParams as AssetAddParams, type AssetRemoveParams as AssetRemoveParams, };
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=albums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"albums.d.ts","sourceRoot":"","sources":["../../src/resources/albums/albums.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EACL,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACP;OACM,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAElD,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAE9D;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIpF;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAI9E;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAA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