@sparkvault/sdk-mobile 7.0.1 → 7.0.3
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/README.md +18 -1
- package/dist/account.d.ts +42 -0
- package/dist/account.js +23 -0
- package/dist/account.js.map +1 -1
- package/dist/app-sdk/upload-publication.d.ts +52 -1
- package/dist/app-sdk/upload-publication.js +57 -1
- package/dist/app-sdk/upload-publication.js.map +1 -1
- package/dist/http.js +1 -1
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ingots.d.ts +26 -1
- package/dist/ingots.js +43 -7
- package/dist/ingots.js.map +1 -1
- package/dist/ingots.test-d.d.ts +25 -0
- package/dist/ingots.test-d.js +15 -0
- package/dist/ingots.test-d.js.map +1 -0
- package/dist/types.d.ts +51 -4
- package/package.json +1 -1
- package/src/account.ts +53 -0
- package/src/app-sdk/upload-publication.js +63 -1
- package/src/http.ts +1 -1
- package/src/index.ts +1 -0
- package/src/ingots.test-d.ts +46 -0
- package/src/ingots.ts +65 -8
- package/src/types.ts +51 -4
package/src/types.ts
CHANGED
|
@@ -67,6 +67,13 @@ export interface SparkVaultUser {
|
|
|
67
67
|
name?: string;
|
|
68
68
|
role: OrgRole;
|
|
69
69
|
has_passkey?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether this user is the account owner (the member whose email is the
|
|
72
|
+
* account's email), who alone may delete the account. Only GET /v1/profile
|
|
73
|
+
* sends it: a sign-in, signup or refresh answer, and a profile save's
|
|
74
|
+
* answer, carry no flag.
|
|
75
|
+
*/
|
|
76
|
+
is_account_owner?: boolean;
|
|
70
77
|
created_at: number;
|
|
71
78
|
}
|
|
72
79
|
|
|
@@ -731,6 +738,10 @@ export interface FolderContentsResponse {
|
|
|
731
738
|
|
|
732
739
|
export interface UploadResult {
|
|
733
740
|
ingot_id: string;
|
|
741
|
+
/**
|
|
742
|
+
* The name the ingot is stored under: the server's numbered name under
|
|
743
|
+
* `new_name`, and for a replace the name it was sent, else the one it kept.
|
|
744
|
+
*/
|
|
734
745
|
name: string;
|
|
735
746
|
size_bytes: number;
|
|
736
747
|
storage_location: 's3';
|
|
@@ -749,14 +760,40 @@ export interface UploadResult {
|
|
|
749
760
|
* `retryLater` is set.
|
|
750
761
|
*/
|
|
751
762
|
status?: Ingot['status'];
|
|
763
|
+
/**
|
|
764
|
+
* The ingot's `content_version` (Forge's activation marker) as the strongly
|
|
765
|
+
* consistent read after the transfer found it, null when the server
|
|
766
|
+
* recorded none. It is this upload's publication or a later writer's that
|
|
767
|
+
* already replaced it, so it does not say which publication holds these
|
|
768
|
+
* bytes. A read-modify-write names this upload's own publication, its
|
|
769
|
+
* session's `uploadId` (`IngotUploadSession`), as the next replace's
|
|
770
|
+
* `expectedContentVersion`, so a save built on stale content is refused
|
|
771
|
+
* (412) instead of discarding another writer's changes.
|
|
772
|
+
*/
|
|
773
|
+
content_version: string | null;
|
|
752
774
|
}
|
|
753
775
|
|
|
776
|
+
/**
|
|
777
|
+
* An Ingot's durable sharing settings, as GET and PUT
|
|
778
|
+
* /vaults/:id/ingots/:ingot_id/sharing answer them (apps/api/src/ingots/sharing.js,
|
|
779
|
+
* `formatSharingConfig`; `ingots.test-d.ts` pins the field set).
|
|
780
|
+
*/
|
|
754
781
|
export interface IngotSharingConfig {
|
|
782
|
+
ingot_id: string;
|
|
783
|
+
vault_id: string;
|
|
784
|
+
/** Whether the vault shares files at all. */
|
|
785
|
+
sharing_enabled: boolean;
|
|
755
786
|
shared: boolean;
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
787
|
+
/** Null while the Ingot is not shared. */
|
|
788
|
+
visibility: 'invite_only' | 'authenticated' | 'public' | null;
|
|
789
|
+
/** The Ingot's durable files.sv link; null while it is not shared. */
|
|
790
|
+
public_url: string | null;
|
|
791
|
+
/** The code in `public_url`; null while the Ingot is not shared. */
|
|
792
|
+
link_code: string | null;
|
|
793
|
+
/** Whether the vault makes every Ingot public, which pins this one to Public. */
|
|
794
|
+
vault_all_ingots_public: boolean;
|
|
795
|
+
session_length_seconds: number;
|
|
796
|
+
invites: IngotInvite[];
|
|
760
797
|
}
|
|
761
798
|
|
|
762
799
|
export interface IngotInvite {
|
|
@@ -892,6 +929,16 @@ export interface IngotUploadSession extends TusSessionInfo {
|
|
|
892
929
|
ingotId: string;
|
|
893
930
|
/** Whether the upload minted the ingot (see `UploadResult.created`). */
|
|
894
931
|
created: boolean;
|
|
932
|
+
/**
|
|
933
|
+
* Forge's id for this upload (the session URL's last segment), which the
|
|
934
|
+
* server stamps as the ingot's `content_version` when the upload publishes.
|
|
935
|
+
* Forge acknowledges the final chunk only once the upload published, so an
|
|
936
|
+
* upload that succeeded published as this id. One that failed with its last
|
|
937
|
+
* answer lost may still have published, or publish later: the ingot's
|
|
938
|
+
* `content_version` reading this id says it did, and any other value proves
|
|
939
|
+
* nothing either way.
|
|
940
|
+
*/
|
|
941
|
+
uploadId: string;
|
|
895
942
|
}
|
|
896
943
|
|
|
897
944
|
/**
|