@sogni-ai/sogni-client 5.81.0 → 5.83.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/AGENTS.md +3 -0
- package/CHANGELOG.md +15 -0
- package/README.md +132 -1
- package/dist/Account/TwoFactorRequiredError.d.ts +8 -0
- package/dist/Account/TwoFactorRequiredError.js +14 -0
- package/dist/Account/TwoFactorRequiredError.js.map +1 -0
- package/dist/Account/index.d.ts +43 -0
- package/dist/Account/index.js +97 -13
- package/dist/Account/index.js.map +1 -1
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.js +6 -5
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.js.map +1 -1
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.d.ts +11 -0
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js +43 -5
- package/dist/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js.map +1 -1
- package/dist/ApiClient/WebSocketClient/events.d.ts +12 -0
- package/dist/ApiClient/WebSocketClient/index.d.ts +13 -0
- package/dist/ApiClient/WebSocketClient/index.js +33 -1
- package/dist/ApiClient/WebSocketClient/index.js.map +1 -1
- package/dist/ApiClient/WebSocketClient/messages.d.ts +4 -0
- package/dist/ApiClient/WebSocketClient/types.d.ts +4 -0
- package/dist/ApiClient/index.d.ts +19 -1
- package/dist/ApiClient/index.js +23 -1
- package/dist/ApiClient/index.js.map +1 -1
- package/dist/Changelog/index.d.ts +28 -0
- package/dist/Changelog/index.js +81 -0
- package/dist/Changelog/index.js.map +1 -0
- package/dist/Changelog/types.d.ts +83 -0
- package/dist/Changelog/types.js +3 -0
- package/dist/Changelog/types.js.map +1 -0
- package/dist/MediaEncryption/index.d.ts +153 -0
- package/dist/MediaEncryption/index.js +434 -0
- package/dist/MediaEncryption/index.js.map +1 -0
- package/dist/Projects/Job.d.ts +10 -0
- package/dist/Projects/Job.js +22 -2
- package/dist/Projects/Job.js.map +1 -1
- package/dist/Projects/Project.d.ts +9 -0
- package/dist/Projects/Project.js +13 -0
- package/dist/Projects/Project.js.map +1 -1
- package/dist/Projects/index.d.ts +30 -1
- package/dist/Projects/index.js +214 -59
- package/dist/Projects/index.js.map +1 -1
- package/dist/Projects/recovery.js +4 -0
- package/dist/Projects/recovery.js.map +1 -1
- package/dist/Projects/types/JobProvenance.d.ts +2 -0
- package/dist/Projects/types/RawProject.d.ts +2 -0
- package/dist/Projects/types/index.d.ts +24 -0
- package/dist/Projects/types/index.js.map +1 -1
- package/dist/browser/mediaEncryptionPlayback/encryptedMediaResponse.d.ts +11 -0
- package/dist/browser/mediaEncryptionPlayback/encryptedMediaResponse.js +97 -0
- package/dist/browser/mediaEncryptionPlayback/encryptedMediaResponse.js.map +1 -0
- package/dist/browser/mediaEncryptionPlayback/encryptedMediaWorker.d.ts +5 -0
- package/dist/browser/mediaEncryptionPlayback/encryptedMediaWorker.js +109 -0
- package/dist/browser/mediaEncryptionPlayback/encryptedMediaWorker.js.map +1 -0
- package/dist/browser/mediaEncryptionPlayback/encryptedPlayback.d.ts +12 -0
- package/dist/browser/mediaEncryptionPlayback/encryptedPlayback.js +169 -0
- package/dist/browser/mediaEncryptionPlayback/encryptedPlayback.js.map +1 -0
- package/dist/browser/mediaEncryptionPlayback/index.d.ts +3 -0
- package/dist/browser/mediaEncryptionPlayback/index.js +20 -0
- package/dist/browser/mediaEncryptionPlayback/index.js.map +1 -0
- package/dist/index.d.ts +53 -4
- package/dist/index.js +25 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/RestClient.d.ts +6 -0
- package/dist/lib/RestClient.js +12 -0
- package/dist/lib/RestClient.js.map +1 -1
- package/dist/lib/mediaEncryption/capability.d.ts +16 -0
- package/dist/lib/mediaEncryption/capability.js +12 -0
- package/dist/lib/mediaEncryption/capability.js.map +1 -0
- package/dist/lib/mediaEncryption/crypto.d.ts +36 -0
- package/dist/lib/mediaEncryption/crypto.js +169 -0
- package/dist/lib/mediaEncryption/crypto.js.map +1 -0
- package/dist/lib/mediaEncryption/format.d.ts +62 -0
- package/dist/lib/mediaEncryption/format.js +167 -0
- package/dist/lib/mediaEncryption/format.js.map +1 -0
- package/dist/lib/mediaEncryption/index.d.ts +12 -0
- package/dist/lib/mediaEncryption/index.js +46 -0
- package/dist/lib/mediaEncryption/index.js.map +1 -0
- package/dist/lib/mediaEncryption/inputKeys.d.ts +24 -0
- package/dist/lib/mediaEncryption/inputKeys.js +102 -0
- package/dist/lib/mediaEncryption/inputKeys.js.map +1 -0
- package/dist/lib/mediaEncryption/networks.d.ts +14 -0
- package/dist/lib/mediaEncryption/networks.js +22 -0
- package/dist/lib/mediaEncryption/networks.js.map +1 -0
- package/dist/lib/mediaEncryption/recipient.d.ts +17 -0
- package/dist/lib/mediaEncryption/recipient.js +106 -0
- package/dist/lib/mediaEncryption/recipient.js.map +1 -0
- package/dist/lib/mediaEncryption/redact.d.ts +5 -0
- package/dist/lib/mediaEncryption/redact.js +34 -0
- package/dist/lib/mediaEncryption/redact.js.map +1 -0
- package/dist/lib/mediaEncryption/remote.d.ts +18 -0
- package/dist/lib/mediaEncryption/remote.js +243 -0
- package/dist/lib/mediaEncryption/remote.js.map +1 -0
- package/dist/types/ErrorData.d.ts +15 -0
- package/dist/types/ErrorData.js +15 -1
- package/dist/types/ErrorData.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist-esm/Account/TwoFactorRequiredError.js +11 -0
- package/dist-esm/Account/TwoFactorRequiredError.js.map +1 -0
- package/dist-esm/Account/index.js +97 -13
- package/dist-esm/Account/index.js.map +1 -1
- package/dist-esm/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.js +6 -5
- package/dist-esm/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.js.map +1 -1
- package/dist-esm/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js +43 -5
- package/dist-esm/ApiClient/WebSocketClient/BrowserWebSocketClient/index.js.map +1 -1
- package/dist-esm/ApiClient/WebSocketClient/index.js +33 -1
- package/dist-esm/ApiClient/WebSocketClient/index.js.map +1 -1
- package/dist-esm/ApiClient/index.js +23 -1
- package/dist-esm/ApiClient/index.js.map +1 -1
- package/dist-esm/Changelog/index.js +76 -0
- package/dist-esm/Changelog/index.js.map +1 -0
- package/dist-esm/Changelog/types.js +2 -0
- package/dist-esm/Changelog/types.js.map +1 -0
- package/dist-esm/MediaEncryption/index.js +429 -0
- package/dist-esm/MediaEncryption/index.js.map +1 -0
- package/dist-esm/Projects/Job.js +22 -2
- package/dist-esm/Projects/Job.js.map +1 -1
- package/dist-esm/Projects/Project.js +13 -0
- package/dist-esm/Projects/Project.js.map +1 -1
- package/dist-esm/Projects/index.js +174 -19
- package/dist-esm/Projects/index.js.map +1 -1
- package/dist-esm/Projects/recovery.js +4 -0
- package/dist-esm/Projects/recovery.js.map +1 -1
- package/dist-esm/Projects/types/index.js.map +1 -1
- package/dist-esm/browser/mediaEncryptionPlayback/encryptedMediaResponse.js +93 -0
- package/dist-esm/browser/mediaEncryptionPlayback/encryptedMediaResponse.js.map +1 -0
- package/dist-esm/browser/mediaEncryptionPlayback/encryptedMediaWorker.js +106 -0
- package/dist-esm/browser/mediaEncryptionPlayback/encryptedMediaWorker.js.map +1 -0
- package/dist-esm/browser/mediaEncryptionPlayback/encryptedPlayback.js +166 -0
- package/dist-esm/browser/mediaEncryptionPlayback/encryptedPlayback.js.map +1 -0
- package/dist-esm/browser/mediaEncryptionPlayback/index.js +4 -0
- package/dist-esm/browser/mediaEncryptionPlayback/index.js.map +1 -0
- package/dist-esm/index.js +17 -4
- package/dist-esm/index.js.map +1 -1
- package/dist-esm/lib/RestClient.js +12 -0
- package/dist-esm/lib/RestClient.js.map +1 -1
- package/dist-esm/lib/mediaEncryption/capability.js +9 -0
- package/dist-esm/lib/mediaEncryption/capability.js.map +1 -0
- package/dist-esm/lib/mediaEncryption/crypto.js +157 -0
- package/dist-esm/lib/mediaEncryption/crypto.js.map +1 -0
- package/dist-esm/lib/mediaEncryption/format.js +157 -0
- package/dist-esm/lib/mediaEncryption/format.js.map +1 -0
- package/dist-esm/lib/mediaEncryption/index.js +17 -0
- package/dist-esm/lib/mediaEncryption/index.js.map +1 -0
- package/dist-esm/lib/mediaEncryption/inputKeys.js +94 -0
- package/dist-esm/lib/mediaEncryption/inputKeys.js.map +1 -0
- package/dist-esm/lib/mediaEncryption/networks.js +17 -0
- package/dist-esm/lib/mediaEncryption/networks.js.map +1 -0
- package/dist-esm/lib/mediaEncryption/recipient.js +100 -0
- package/dist-esm/lib/mediaEncryption/recipient.js.map +1 -0
- package/dist-esm/lib/mediaEncryption/redact.js +31 -0
- package/dist-esm/lib/mediaEncryption/redact.js.map +1 -0
- package/dist-esm/lib/mediaEncryption/remote.js +240 -0
- package/dist-esm/lib/mediaEncryption/remote.js.map +1 -0
- package/dist-esm/types/ErrorData.js +14 -0
- package/dist-esm/types/ErrorData.js.map +1 -1
- package/dist-esm/version.js +1 -1
- package/llms-full.txt +52 -1
- package/llms.txt +19 -1
- package/package.json +15 -4
- package/src/Account/TwoFactorRequiredError.ts +12 -0
- package/src/Account/index.ts +183 -3
- package/src/ApiClient/WebSocketClient/BrowserWebSocketClient/ChannelCoordinator.ts +9 -5
- package/src/ApiClient/WebSocketClient/BrowserWebSocketClient/index.ts +42 -4
- package/src/ApiClient/WebSocketClient/events.ts +12 -0
- package/src/ApiClient/WebSocketClient/index.ts +32 -1
- package/src/ApiClient/WebSocketClient/messages.ts +2 -0
- package/src/ApiClient/WebSocketClient/types.ts +4 -0
- package/src/ApiClient/index.ts +31 -1
- package/src/Changelog/index.ts +75 -0
- package/src/Changelog/types.ts +96 -0
- package/src/MediaEncryption/index.ts +500 -0
- package/src/Projects/Job.ts +23 -2
- package/src/Projects/Project.ts +15 -0
- package/src/Projects/index.ts +195 -21
- package/src/Projects/recovery.ts +4 -0
- package/src/Projects/types/JobProvenance.ts +2 -0
- package/src/Projects/types/RawProject.ts +2 -0
- package/src/Projects/types/index.ts +24 -0
- package/src/browser/mediaEncryptionPlayback/encryptedMediaResponse.ts +88 -0
- package/src/browser/mediaEncryptionPlayback/encryptedMediaWorker.ts +103 -0
- package/src/browser/mediaEncryptionPlayback/encryptedPlayback.ts +166 -0
- package/src/browser/mediaEncryptionPlayback/index.ts +3 -0
- package/src/index.ts +78 -3
- package/src/lib/RestClient.ts +13 -0
- package/src/lib/mediaEncryption/capability.ts +17 -0
- package/src/lib/mediaEncryption/crypto.ts +217 -0
- package/src/lib/mediaEncryption/format.ts +209 -0
- package/src/lib/mediaEncryption/index.ts +43 -0
- package/src/lib/mediaEncryption/inputKeys.ts +130 -0
- package/src/lib/mediaEncryption/networks.ts +31 -0
- package/src/lib/mediaEncryption/recipient.ts +118 -0
- package/src/lib/mediaEncryption/redact.ts +30 -0
- package/src/lib/mediaEncryption/remote.ts +259 -0
- package/src/types/ErrorData.ts +18 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import ApiGroup from '../ApiGroup.js';
|
|
2
|
+
import type { ChangelogEntry, ChangelogProduct, ListChangelogOptions, ListChangelogResult } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The public Sogni changelog (`/v1/changelog`): what changed on Sogni for
|
|
5
|
+
* artists, developers and worker operators.
|
|
6
|
+
*
|
|
7
|
+
* These reads need no sign-in, so they work on a client that is not
|
|
8
|
+
* authenticated. Responses may be up to five minutes old; poll no more often
|
|
9
|
+
* than that. A refused request throws `ApiError` with the API's status and
|
|
10
|
+
* message.
|
|
11
|
+
*
|
|
12
|
+
* Full contract: https://docs.sogni.ai/api-reference/changelog/
|
|
13
|
+
*/
|
|
14
|
+
declare class ChangelogApi extends ApiGroup {
|
|
15
|
+
/**
|
|
16
|
+
* One page of published entries, newest first. Pass the returned
|
|
17
|
+
* `nextCursor` as `cursor`, with the same filters, for the next page.
|
|
18
|
+
*/
|
|
19
|
+
list(options?: ListChangelogOptions): Promise<ListChangelogResult>;
|
|
20
|
+
/**
|
|
21
|
+
* One published entry by its id. An id with no published entry throws
|
|
22
|
+
* `ApiError` with status `404` and `payload.errorCode` `204`.
|
|
23
|
+
*/
|
|
24
|
+
get(id: string): Promise<ChangelogEntry>;
|
|
25
|
+
/** The products entries can name, in display order. */
|
|
26
|
+
products(): Promise<ChangelogProduct[]>;
|
|
27
|
+
}
|
|
28
|
+
export default ChangelogApi;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const ApiGroup_js_1 = __importDefault(require("../ApiGroup.js"));
|
|
16
|
+
const index_js_1 = require("../ApiClient/index.js");
|
|
17
|
+
function joined(value) {
|
|
18
|
+
return Array.isArray(value) ? value.join(',') : value;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The public Sogni changelog (`/v1/changelog`): what changed on Sogni for
|
|
22
|
+
* artists, developers and worker operators.
|
|
23
|
+
*
|
|
24
|
+
* These reads need no sign-in, so they work on a client that is not
|
|
25
|
+
* authenticated. Responses may be up to five minutes old; poll no more often
|
|
26
|
+
* than that. A refused request throws `ApiError` with the API's status and
|
|
27
|
+
* message.
|
|
28
|
+
*
|
|
29
|
+
* Full contract: https://docs.sogni.ai/api-reference/changelog/
|
|
30
|
+
*/
|
|
31
|
+
class ChangelogApi extends ApiGroup_js_1.default {
|
|
32
|
+
/**
|
|
33
|
+
* One page of published entries, newest first. Pass the returned
|
|
34
|
+
* `nextCursor` as `cursor`, with the same filters, for the next page.
|
|
35
|
+
*/
|
|
36
|
+
list() {
|
|
37
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
38
|
+
const res = yield this.client.rest.get('/v1/changelog', {
|
|
39
|
+
audience: joined(options.audience),
|
|
40
|
+
product: joined(options.product),
|
|
41
|
+
type: joined(options.type),
|
|
42
|
+
since: options.since,
|
|
43
|
+
until: options.until,
|
|
44
|
+
actionRequired: options.actionRequired ? 'true' : undefined,
|
|
45
|
+
limit: options.limit,
|
|
46
|
+
cursor: options.cursor
|
|
47
|
+
});
|
|
48
|
+
return res.data;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* One published entry by its id. An id with no published entry throws
|
|
53
|
+
* `ApiError` with status `404` and `payload.errorCode` `204`.
|
|
54
|
+
*/
|
|
55
|
+
get(id) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
var _a;
|
|
58
|
+
const res = yield this.client.rest.get(`/v1/changelog/${encodeURIComponent(id)}`);
|
|
59
|
+
const entry = (_a = res.data) === null || _a === void 0 ? void 0 : _a.entry;
|
|
60
|
+
if (!entry) {
|
|
61
|
+
// An empty id requests the list itself, and `products` or `feed.json` the
|
|
62
|
+
// product list or the feed; none of them is an entry.
|
|
63
|
+
throw new index_js_1.ApiError(404, {
|
|
64
|
+
status: 'error',
|
|
65
|
+
message: 'Changelog entry not found',
|
|
66
|
+
errorCode: 204
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return entry;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/** The products entries can name, in display order. */
|
|
73
|
+
products() {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const res = yield this.client.rest.get('/v1/changelog/products');
|
|
76
|
+
return res.data.products;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.default = ChangelogApi;
|
|
81
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Changelog/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iEAAsC;AACtC,oDAA8D;AAQ9D,SAAS,MAAM,CAAC,KAAoC;IAClD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACxD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,YAAa,SAAQ,qBAAQ;IACjC;;;OAGG;IACG,IAAI;6DAAC,UAAgC,EAAE;YAC3C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAmC,eAAe,EAAE;gBACxF,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;gBAClC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;gBAChC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;gBAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,cAAc,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;gBAC3D,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB,CAAC,CAAC;YACH,OAAO,GAAG,CAAC,IAAI,CAAC;QAClB,CAAC;KAAA;IAED;;;OAGG;IACG,GAAG,CAAC,EAAU;;;YAClB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CACpC,iBAAiB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAC1C,CAAC;YACF,MAAM,KAAK,GAAG,MAAA,GAAG,CAAC,IAAI,0CAAE,KAAK,CAAC;YAC9B,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,0EAA0E;gBAC1E,sDAAsD;gBACtD,MAAM,IAAI,mBAAQ,CAAC,GAAG,EAAE;oBACtB,MAAM,EAAE,OAAO;oBACf,OAAO,EAAE,2BAA2B;oBACpC,SAAS,EAAE,GAAG;iBACf,CAAC,CAAC;YACL,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KAAA;IAED,uDAAuD;IACjD,QAAQ;;YACZ,MAAM,GAAG,GACP,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CACxB,wBAAwB,CACzB,CAAC;YACJ,OAAO,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC3B,CAAC;KAAA;CACF;AAED,kBAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/** Who a changelog entry is for. */
|
|
2
|
+
export type ChangelogAudience = 'artist' | 'developer' | 'worker';
|
|
3
|
+
/**
|
|
4
|
+
* The kind of change. Every entry has exactly one:
|
|
5
|
+
* - `new`: something you could not do before
|
|
6
|
+
* - `improved`: a change to something that already worked
|
|
7
|
+
* - `fixed`: a fix
|
|
8
|
+
* - `release`: a versioned release, such as a worker or SDK version
|
|
9
|
+
* - `deprecated`: still works, until `effectiveAt`
|
|
10
|
+
* - `removed`: no longer available
|
|
11
|
+
* - `notice`: anything else you should know
|
|
12
|
+
*/
|
|
13
|
+
export type ChangelogEntryType = 'new' | 'improved' | 'fixed' | 'release' | 'deprecated' | 'removed' | 'notice';
|
|
14
|
+
/** A page related to a changelog entry. */
|
|
15
|
+
export interface ChangelogLink {
|
|
16
|
+
label: string;
|
|
17
|
+
url: string;
|
|
18
|
+
}
|
|
19
|
+
/** One published changelog entry. Times are ISO 8601 UTC strings. */
|
|
20
|
+
export interface ChangelogEntry {
|
|
21
|
+
/** Permanent identifier. It does not change once the entry is published. */
|
|
22
|
+
id: string;
|
|
23
|
+
/** The entry's page on sogni.ai. */
|
|
24
|
+
url: string;
|
|
25
|
+
title: string;
|
|
26
|
+
/** Short summary in plain text. */
|
|
27
|
+
summary: string;
|
|
28
|
+
/** The full text in Markdown. */
|
|
29
|
+
bodyMarkdown: string | null;
|
|
30
|
+
type: ChangelogEntryType;
|
|
31
|
+
audiences: ChangelogAudience[];
|
|
32
|
+
/** Product ids, as listed by `changelog.products()`. */
|
|
33
|
+
products: string[];
|
|
34
|
+
/** The product version the change shipped in. */
|
|
35
|
+
version: string | null;
|
|
36
|
+
links: ChangelogLink[];
|
|
37
|
+
/** `true` when you need to change something, such as for a model retirement. */
|
|
38
|
+
actionRequired: boolean;
|
|
39
|
+
/** When the change takes effect. For a deprecation or removal, the day the old behavior stops working. */
|
|
40
|
+
effectiveAt: string | null;
|
|
41
|
+
/** When the entry was published. Lists sort and filter on it. */
|
|
42
|
+
publishedAt: string;
|
|
43
|
+
/** When any public field of the entry last changed. */
|
|
44
|
+
updatedAt: string;
|
|
45
|
+
}
|
|
46
|
+
/** A product that changelog entries can name. */
|
|
47
|
+
export interface ChangelogProduct {
|
|
48
|
+
/** The id to use with the `product` filter. */
|
|
49
|
+
id: string;
|
|
50
|
+
/** Display name. */
|
|
51
|
+
label: string;
|
|
52
|
+
audiences: ChangelogAudience[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Filters and paging for `changelog.list()`. Every field is optional. An entry
|
|
56
|
+
* must match every filter given; a filter given several values matches entries
|
|
57
|
+
* that have any of them (at most 20 values per filter).
|
|
58
|
+
*/
|
|
59
|
+
export interface ListChangelogOptions {
|
|
60
|
+
audience?: ChangelogAudience | ChangelogAudience[];
|
|
61
|
+
/** Product ids from `changelog.products()`. */
|
|
62
|
+
product?: string | string[];
|
|
63
|
+
type?: ChangelogEntryType | ChangelogEntryType[];
|
|
64
|
+
/**
|
|
65
|
+
* Entries published at or after this time: an ISO 8601 date (`'2026-11-01'`,
|
|
66
|
+
* read as midnight UTC) or a date-time with a zone (`'2026-11-01T17:00:00Z'`).
|
|
67
|
+
*/
|
|
68
|
+
since?: string;
|
|
69
|
+
/** Entries published before this time, in the same format as `since`. */
|
|
70
|
+
until?: string;
|
|
71
|
+
/** `true` lists only the entries you need to act on. */
|
|
72
|
+
actionRequired?: boolean;
|
|
73
|
+
/** Entries per page. The API defaults to 50 and returns at most 100. */
|
|
74
|
+
limit?: number;
|
|
75
|
+
/** The previous page's `nextCursor`. Send the same filters with it. */
|
|
76
|
+
cursor?: string;
|
|
77
|
+
}
|
|
78
|
+
/** One page of changelog entries, newest first. */
|
|
79
|
+
export interface ListChangelogResult {
|
|
80
|
+
entries: ChangelogEntry[];
|
|
81
|
+
/** Pass as `cursor` to get the next page. `null` on the last page. */
|
|
82
|
+
nextCursor: string | null;
|
|
83
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/Changelog/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import ApiGroup, { ApiConfig } from '../ApiGroup.js';
|
|
2
|
+
import { type DecryptedMediaReader } from '../lib/mediaEncryption/remote.js';
|
|
3
|
+
import { MediaSource } from '../lib/mediaEncryption/index.js';
|
|
4
|
+
export interface MediaEncryptionApiEvents {
|
|
5
|
+
/** An account key became available to this client. */
|
|
6
|
+
unlocked: void;
|
|
7
|
+
/** This client let go of the account key. Encrypted media stays encrypted. */
|
|
8
|
+
locked: void;
|
|
9
|
+
/** The server's answer to whether this account may encrypt changed. */
|
|
10
|
+
availabilityChanged: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** `mediaEncryption` field of the `jobRequest` socket message. */
|
|
13
|
+
export interface MediaEncryptionWireParams {
|
|
14
|
+
version: number;
|
|
15
|
+
/** Base64 project key. */
|
|
16
|
+
key: string;
|
|
17
|
+
/** Base64 recipient record. */
|
|
18
|
+
recipient: string;
|
|
19
|
+
/** Base64 keys of the project's input files. */
|
|
20
|
+
inputKeys?: string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Encrypts one project's uploads.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export interface ProjectMediaEncryption {
|
|
27
|
+
/** The job request's field. Complete only once every input has been encrypted. */
|
|
28
|
+
wire(): MediaEncryptionWireParams;
|
|
29
|
+
/** Encrypt one input. Asking again for the same media object returns the same file. */
|
|
30
|
+
encrypt(media: MediaSource, contentType?: string): Promise<Blob>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Optional encryption of project media for the signed-in account.
|
|
34
|
+
*
|
|
35
|
+
* Create the client with `mediaEncryption: 'auto'` to encrypt every eligible
|
|
36
|
+
* project once media encryption is available for the account. Without it, the
|
|
37
|
+
* client works as before. See {@link SogniClientConfig.mediaEncryption}.
|
|
38
|
+
*
|
|
39
|
+
* @example Encrypt every eligible project, and read a result
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const sogni = await SogniClient.createInstance({ appId, mediaEncryption: 'auto' });
|
|
42
|
+
* await sogni.account.login('username', 'password');
|
|
43
|
+
* const project = await sogni.projects.create(params);
|
|
44
|
+
* await project.waitForCompletion();
|
|
45
|
+
* const image = await project.jobs[0].getResultData(); // decrypted Blob
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare class MediaEncryptionApi extends ApiGroup<MediaEncryptionApiEvents> {
|
|
49
|
+
private keyring;
|
|
50
|
+
/** Invalidates asynchronous key work when the key is replaced or dropped. */
|
|
51
|
+
private keyGeneration;
|
|
52
|
+
private readonly mediaReaders;
|
|
53
|
+
/** The last `mediaEncryptionAvailable` the server sent on this connection. */
|
|
54
|
+
private serverAvailable;
|
|
55
|
+
/** The account-key request in flight, for the session that started it. */
|
|
56
|
+
private keyRequest;
|
|
57
|
+
/** No new account-key request before this time, unless the account signs in again. */
|
|
58
|
+
private keyRetryAt;
|
|
59
|
+
/** Media encryption was turned off for the account: no key is requested again this session. */
|
|
60
|
+
private keyTurnedOff;
|
|
61
|
+
constructor(config: ApiConfig);
|
|
62
|
+
/**
|
|
63
|
+
* `true` when this client was created with `mediaEncryption: 'auto'`.
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
get automatic(): boolean;
|
|
67
|
+
/** An 'auto' client that tells the servers it reads encrypted media. */
|
|
68
|
+
private get declaresCapability();
|
|
69
|
+
/**
|
|
70
|
+
* Whether media encryption is available for this account right now. A
|
|
71
|
+
* client created with `mediaEncryption: 'auto'` encrypts new projects only
|
|
72
|
+
* while this is `true`.
|
|
73
|
+
*/
|
|
74
|
+
get available(): boolean;
|
|
75
|
+
private setServerAvailable;
|
|
76
|
+
/** True when this data starts with the encrypted-media signature. Needs the first 8 bytes. */
|
|
77
|
+
isEncrypted(bytes: Uint8Array | ArrayBuffer): boolean;
|
|
78
|
+
/** Whether this client can open the signed-in account's encrypted media. */
|
|
79
|
+
isUnlocked(): Promise<boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* Use these 32 bytes as the signed-in account's media key. A client created
|
|
82
|
+
* with `mediaEncryption: 'auto'` manages the key itself. The key is dropped
|
|
83
|
+
* when the account signs out or changes.
|
|
84
|
+
*/
|
|
85
|
+
setAccountKey(secret: Uint8Array): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Drop the account key from this client. With `mediaEncryption: 'auto'` it
|
|
88
|
+
* is obtained again the next time it is needed.
|
|
89
|
+
*/
|
|
90
|
+
lock(): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Decrypt media downloaded from a result, preview or input URL. Returns a
|
|
93
|
+
* Blob typed with the media's real MIME type. Pass `key` only for media that
|
|
94
|
+
* the account key cannot open.
|
|
95
|
+
*/
|
|
96
|
+
decrypt(media: MediaSource, options?: {
|
|
97
|
+
key?: Uint8Array;
|
|
98
|
+
}): Promise<Blob>;
|
|
99
|
+
/**
|
|
100
|
+
* Open encrypted video/audio for seeking without downloading the whole file.
|
|
101
|
+
* The URL must support HTTP byte ranges and expose Content-Range to this
|
|
102
|
+
* origin. Close the reader when playback no longer needs it; locking or
|
|
103
|
+
* changing the account also closes it and aborts pending requests.
|
|
104
|
+
*
|
|
105
|
+
* Ranges use [start, end) offsets in the DECRYPTED file. Apps can serve these
|
|
106
|
+
* through their service worker to a normal audio/video element. Prefer
|
|
107
|
+
* `stream()` for long ranges; `read()` collects the requested range in memory.
|
|
108
|
+
*/
|
|
109
|
+
openDecrypted(url: string, options?: {
|
|
110
|
+
init?: RequestInit;
|
|
111
|
+
}): Promise<DecryptedMediaReader>;
|
|
112
|
+
/**
|
|
113
|
+
* Download a URL and return its content decrypted. Content that is not
|
|
114
|
+
* encrypted is returned as downloaded, so callers can use one path for both.
|
|
115
|
+
* Pass `requireEncrypted` to treat unencrypted content as an error instead.
|
|
116
|
+
*/
|
|
117
|
+
fetchDecrypted(url: string, options?: {
|
|
118
|
+
init?: RequestInit;
|
|
119
|
+
requireEncrypted?: boolean;
|
|
120
|
+
}): Promise<Blob>;
|
|
121
|
+
/**
|
|
122
|
+
* Decrypt downloaded media when it is encrypted, and return anything else as it is.
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
_openIfEncrypted(blob: Blob, requireEncrypted?: boolean): Promise<Blob>;
|
|
126
|
+
/**
|
|
127
|
+
* For `mediaEncryption: 'auto'`: whether a project submitted now can be encrypted.
|
|
128
|
+
* @internal
|
|
129
|
+
*/
|
|
130
|
+
_canEncryptAutomatically(): Promise<boolean>;
|
|
131
|
+
/**
|
|
132
|
+
* Start encrypting a new project.
|
|
133
|
+
* @internal
|
|
134
|
+
*/
|
|
135
|
+
_createProjectEncryption(): Promise<ProjectMediaEncryption>;
|
|
136
|
+
private holdsKey;
|
|
137
|
+
/**
|
|
138
|
+
* For `mediaEncryption: 'auto'`: get the signed-in account's key once media
|
|
139
|
+
* encryption is available for it. Resolves `false`, and never throws, when
|
|
140
|
+
* there is no key to use.
|
|
141
|
+
*/
|
|
142
|
+
private ensureAccountKey;
|
|
143
|
+
private fetchAccountKey;
|
|
144
|
+
private resolveProjectKey;
|
|
145
|
+
private requireAccountKeys;
|
|
146
|
+
private setKeyring;
|
|
147
|
+
private forgetKeys;
|
|
148
|
+
private beginKeyChange;
|
|
149
|
+
private closeMediaReaders;
|
|
150
|
+
private captureMediaSession;
|
|
151
|
+
private assertCurrentKeyChange;
|
|
152
|
+
}
|
|
153
|
+
export default MediaEncryptionApi;
|