@maxim_mazurok/gapi.client.discoveryengine-v1alpha 0.0.20250207 → 0.0.20250211

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +281 -1
  2. package/package.json +1 -1
  3. package/readme.md +5 -0
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://discoveryengine.googleapis.com/$discovery/rest?version=v1alpha
12
- // Revision: 20250207
12
+ // Revision: 20250211
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -28,6 +28,208 @@ declare namespace gapi.client {
28
28
  ): void;
29
29
 
30
30
  namespace discoveryengine {
31
+ interface ApiservingMediaRequestInfo {
32
+ /** The number of current bytes uploaded or downloaded. */
33
+ currentBytes?: string;
34
+ /** Data to be copied to backend requests. Custom data is returned to Scotty in the agent_state field, which Scotty will then provide in subsequent upload notifications. */
35
+ customData?: string;
36
+ /** Set if the http request info is diff encoded. The value of this field is the version number of the base revision. This is corresponding to Apiary's mediaDiffObjectVersion (//depot/google3/java/com/google/api/server/media/variable/DiffObjectVersionVariable.java). See go/esf-scotty-diff-upload for more information. */
37
+ diffObjectVersion?: string;
38
+ /** The existence of the final_status field indicates that this is the last call to the agent for this request_id. http://google3/uploader/agent/scotty_agent.proto?l=737&rcl=347601929 */
39
+ finalStatus?: number;
40
+ /** The type of notification received from Scotty. */
41
+ notificationType?: string;
42
+ /** The Scotty request ID. */
43
+ requestId?: string;
44
+ /** The partition of the Scotty server handling this request. type is uploader_service.RequestReceivedParamsServingInfo LINT.IfChange(request_received_params_serving_info_annotations) LINT.ThenChange() */
45
+ requestReceivedParamsServingInfo?: string;
46
+ /** The total size of the file. */
47
+ totalBytes?: string;
48
+ /** Whether the total bytes field contains an estimated data. */
49
+ totalBytesIsEstimated?: boolean;
50
+ }
51
+ interface ApiservingMediaResponseInfo {
52
+ /** Data to copy from backend response to the next backend requests. Custom data is returned to Scotty in the agent_state field, which Scotty will then provide in subsequent upload notifications. */
53
+ customData?: string;
54
+ /** Specifies any transformation to be applied to data before persisting it or retrieving from storage. E.g., encryption options for blobstore2. This should be of the form uploader_service.DataStorageTransform. */
55
+ dataStorageTransform?: string;
56
+ /** Specifies the Scotty Drop Target to use for uploads. If present in a media response, Scotty does not upload to a standard drop zone. Instead, Scotty saves the upload directly to the location specified in this drop target. Unlike drop zones, the drop target is the final storage location for an upload. So, the agent does not need to clone the blob at the end of the upload. The agent is responsible for garbage collecting any orphaned blobs that may occur due to aborted uploads. For more information, see the drop target design doc here: http://goto/ScottyDropTarget This field will be preferred to dynamicDropzone. If provided, the identified field in the response must be of the type uploader.agent.DropTarget. */
57
+ dynamicDropTarget?: string;
58
+ /** Specifies the Scotty dropzone to use for uploads. */
59
+ dynamicDropzone?: string;
60
+ /** Diff Updates must respond to a START notification with this Media proto to tell Scotty to decode the diff encoded payload and apply the diff against this field. If the request was diff encoded, but this field is not set, Scotty will treat the encoding as identity. This is corresponding to Apiary's DiffUploadResponse.original_object (//depot/google3/gdata/rosy/proto/data.proto?l=413). See go/esf-scotty-diff-upload for more information. */
61
+ mediaForDiff?: GdataMedia;
62
+ /** Request class to use for all Blobstore operations for this request. */
63
+ requestClass?: string;
64
+ /** Requester ID passed along to be recorded in the Scotty logs */
65
+ scottyAgentUserId?: string;
66
+ /** Customer-specific data to be recorded in the Scotty logs type is logs_proto_scotty.CustomerLog */
67
+ scottyCustomerLog?: string;
68
+ /** Specifies the TrafficClass that Scotty should use for any RPCs to fetch the response bytes. Will override the traffic class GTOS of the incoming http request. This is a temporary field to facilitate whitelisting and experimentation by the bigstore agent only. For instance, this does not apply to RTMP reads. WARNING: DO NOT USE WITHOUT PERMISSION FROM THE SCOTTY TEAM. */
69
+ trafficClassField?: string;
70
+ /** Tells Scotty to verify hashes on the agent's behalf by parsing out the X-Goog-Hash header. */
71
+ verifyHashFromHeader?: boolean;
72
+ }
73
+ interface GdataBlobstore2Info {
74
+ /** The blob generation id. */
75
+ blobGeneration?: string;
76
+ /** The blob id, e.g., /blobstore/prod/playground/scotty */
77
+ blobId?: string;
78
+ /** Read handle passed from Bigstore -> Scotty for a GCS download. This is a signed, serialized blobstore2.ReadHandle proto which must never be set outside of Bigstore, and is not applicable to non-GCS media downloads. */
79
+ downloadReadHandle?: string;
80
+ /** The blob read token. Needed to read blobs that have not been replicated. Might not be available until the final call. */
81
+ readToken?: string;
82
+ /** Metadata passed from Blobstore -> Scotty for a new GCS upload. This is a signed, serialized blobstore2.BlobMetadataContainer proto which must never be consumed outside of Bigstore, and is not applicable to non-GCS media uploads. */
83
+ uploadMetadataContainer?: string;
84
+ }
85
+ interface GdataCompositeMedia {
86
+ /** Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef. */
87
+ blobRef?: string;
88
+ /** Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob. */
89
+ blobstore2Info?: GdataBlobstore2Info;
90
+ /** A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field. */
91
+ cosmoBinaryReference?: string;
92
+ /** crc32.c hash for the payload. */
93
+ crc32cHash?: number;
94
+ /** Media data, set if reference_type is INLINE */
95
+ inline?: string;
96
+ /** Size of the data, in bytes */
97
+ length?: string;
98
+ /** MD5 hash for the payload. */
99
+ md5Hash?: string;
100
+ /** Reference to a TI Blob, set if reference_type is BIGSTORE_REF. */
101
+ objectId?: GdataObjectId;
102
+ /** Path to the data, set if reference_type is PATH */
103
+ path?: string;
104
+ /** Describes what the field reference contains. */
105
+ referenceType?: string;
106
+ /** SHA-1 hash for the payload. */
107
+ sha1Hash?: string;
108
+ }
109
+ interface GdataContentTypeInfo {
110
+ /** Scotty's best guess of what the content type of the file is. */
111
+ bestGuess?: string;
112
+ /** The content type of the file derived by looking at specific bytes (i.e. "magic bytes") of the actual file. */
113
+ fromBytes?: string;
114
+ /** The content type of the file derived from the file extension of the original file name used by the client. */
115
+ fromFileName?: string;
116
+ /** The content type of the file as specified in the request headers, multipart headers, or RUPIO start request. */
117
+ fromHeader?: string;
118
+ /** The content type of the file derived from the file extension of the URL path. The URL path is assumed to represent a file name (which is typically only true for agents that are providing a REST API). */
119
+ fromUrlPath?: string;
120
+ }
121
+ interface GdataDiffChecksumsResponse {
122
+ /** Exactly one of these fields must be populated. If checksums_location is filled, the server will return the corresponding contents to the user. If object_location is filled, the server will calculate the checksums based on the content there and return that to the user. For details on the format of the checksums, see http://go/scotty-diff-protocol. */
123
+ checksumsLocation?: GdataCompositeMedia;
124
+ /** The chunk size of checksums. Must be a multiple of 256KB. */
125
+ chunkSizeBytes?: string;
126
+ /** If set, calculate the checksums based on the contents and return them to the caller. */
127
+ objectLocation?: GdataCompositeMedia;
128
+ /** The total size of the server object. */
129
+ objectSizeBytes?: string;
130
+ /** The object version of the object the checksums are being returned for. */
131
+ objectVersion?: string;
132
+ }
133
+ interface GdataDiffDownloadResponse {
134
+ /** The original object location. */
135
+ objectLocation?: GdataCompositeMedia;
136
+ }
137
+ interface GdataDiffUploadRequest {
138
+ /** The location of the checksums for the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received. For details on the format of the checksums, see http://go/scotty-diff-protocol. */
139
+ checksumsInfo?: GdataCompositeMedia;
140
+ /** The location of the new object. Agents must clone the object located here, as the upload server will delete the contents once a response is received. */
141
+ objectInfo?: GdataCompositeMedia;
142
+ /** The object version of the object that is the base version the incoming diff script will be applied to. This field will always be filled in. */
143
+ objectVersion?: string;
144
+ }
145
+ interface GdataDiffUploadResponse {
146
+ /** The object version of the object at the server. Must be included in the end notification response. The version in the end notification response must correspond to the new version of the object that is now stored at the server, after the upload. */
147
+ objectVersion?: string;
148
+ /** The location of the original file for a diff upload request. Must be filled in if responding to an upload start notification. */
149
+ originalObject?: GdataCompositeMedia;
150
+ }
151
+ interface GdataDiffVersionResponse {
152
+ /** The total size of the server object. */
153
+ objectSizeBytes?: string;
154
+ /** The version of the object stored at the server. */
155
+ objectVersion?: string;
156
+ }
157
+ interface GdataDownloadParameters {
158
+ /** A boolean to be returned in the response to Scotty. Allows/disallows gzip encoding of the payload content when the server thinks it's advantageous (hence, does not guarantee compression) which allows Scotty to GZip the response to the client. */
159
+ allowGzipCompression?: boolean;
160
+ /** Determining whether or not Apiary should skip the inclusion of any Content-Range header on its response to Scotty. */
161
+ ignoreRange?: boolean;
162
+ }
163
+ interface GdataMedia {
164
+ /** Deprecated, use one of explicit hash type fields instead. Algorithm used for calculating the hash. As of 2011/01/21, "MD5" is the only possible value for this field. New values may be added at any time. */
165
+ algorithm?: string;
166
+ /** Use object_id instead. */
167
+ bigstoreObjectRef?: string;
168
+ /** Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef. */
169
+ blobRef?: string;
170
+ /** Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob. */
171
+ blobstore2Info?: GdataBlobstore2Info;
172
+ /** A composite media composed of one or more media objects, set if reference_type is COMPOSITE_MEDIA. The media length field must be set to the sum of the lengths of all composite media objects. Note: All composite media must have length specified. */
173
+ compositeMedia?: GdataCompositeMedia[];
174
+ /** MIME type of the data */
175
+ contentType?: string;
176
+ /** Extended content type information provided for Scotty uploads. */
177
+ contentTypeInfo?: GdataContentTypeInfo;
178
+ /** A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field. */
179
+ cosmoBinaryReference?: string;
180
+ /** For Scotty Uploads: Scotty-provided hashes for uploads For Scotty Downloads: (WARNING: DO NOT USE WITHOUT PERMISSION FROM THE SCOTTY TEAM.) A Hash provided by the agent to be used to verify the data being downloaded. Currently only supported for inline payloads. Further, only crc32c_hash is currently supported. */
181
+ crc32cHash?: number;
182
+ /** Set if reference_type is DIFF_CHECKSUMS_RESPONSE. */
183
+ diffChecksumsResponse?: GdataDiffChecksumsResponse;
184
+ /** Set if reference_type is DIFF_DOWNLOAD_RESPONSE. */
185
+ diffDownloadResponse?: GdataDiffDownloadResponse;
186
+ /** Set if reference_type is DIFF_UPLOAD_REQUEST. */
187
+ diffUploadRequest?: GdataDiffUploadRequest;
188
+ /** Set if reference_type is DIFF_UPLOAD_RESPONSE. */
189
+ diffUploadResponse?: GdataDiffUploadResponse;
190
+ /** Set if reference_type is DIFF_VERSION_RESPONSE. */
191
+ diffVersionResponse?: GdataDiffVersionResponse;
192
+ /** Parameters for a media download. */
193
+ downloadParameters?: GdataDownloadParameters;
194
+ /** Original file name */
195
+ filename?: string;
196
+ /** Deprecated, use one of explicit hash type fields instead. These two hash related fields will only be populated on Scotty based media uploads and will contain the content of the hash group in the NotificationRequest: http://cs/#google3/blobstore2/api/scotty/service/proto/upload_listener.proto&q=class:Hash Hex encoded hash value of the uploaded media. */
197
+ hash?: string;
198
+ /** For Scotty uploads only. If a user sends a hash code and the backend has requested that Scotty verify the upload against the client hash, Scotty will perform the check on behalf of the backend and will reject it if the hashes don't match. This is set to true if Scotty performed this verification. */
199
+ hashVerified?: boolean;
200
+ /** Media data, set if reference_type is INLINE */
201
+ inline?: string;
202
+ /** |is_potential_retry| is set false only when Scotty is certain that it has not sent the request before. When a client resumes an upload, this field must be set true in agent calls, because Scotty cannot be certain that it has never sent the request before due to potential failure in the session state persistence. */
203
+ isPotentialRetry?: boolean;
204
+ /** Size of the data, in bytes */
205
+ length?: string;
206
+ /** Scotty-provided MD5 hash for an upload. */
207
+ md5Hash?: string;
208
+ /** Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA. */
209
+ mediaId?: string;
210
+ /** Reference to a TI Blob, set if reference_type is BIGSTORE_REF. */
211
+ objectId?: GdataObjectId;
212
+ /** Path to the data, set if reference_type is PATH */
213
+ path?: string;
214
+ /** Describes what the field reference contains. */
215
+ referenceType?: string;
216
+ /** Scotty-provided SHA1 hash for an upload. */
217
+ sha1Hash?: string;
218
+ /** Scotty-provided SHA256 hash for an upload. */
219
+ sha256Hash?: string;
220
+ /** Time at which the media data was last updated, in milliseconds since UNIX epoch */
221
+ timestamp?: string;
222
+ /** A unique fingerprint/version id for the media data */
223
+ token?: string;
224
+ }
225
+ interface GdataObjectId {
226
+ /** The name of the bucket to which this object belongs. */
227
+ bucketName?: string;
228
+ /** Generation of the object. Generations are monotonically increasing across writes, allowing them to be be compared to determine which generation is newer. If this is omitted in a request, then you are requesting the live object. See http://go/bigstore-versions */
229
+ generation?: string;
230
+ /** The name of the object. */
231
+ objectName?: string;
232
+ }
31
233
  interface GoogleApiDistribution {
32
234
  /** The number of values in each bucket of the histogram, as described in `bucket_options`. If the distribution does not have a histogram, then omit this field. If there is a histogram, then the sum of the values in `bucket_counts` must equal the value in the `count` field of the distribution. If present, `bucket_counts` should contain N values, where N is the number of buckets specified in `bucket_options`. If you supply fewer than N values, the remaining values are assumed to be 0. The order of the values in `bucket_counts` follows the bucket numbering schemes described for the three bucket types. The first value must be the count for the underflow bucket (number 0). The next N-2 values are the counts for the finite buckets (number 1 through N-2). The N'th value in `bucket_counts` is the count for the overflow bucket (number N-1). */
33
235
  bucketCounts?: string[];
@@ -5315,6 +5517,22 @@ declare namespace gapi.client {
5315
5517
  /** The Google Workspace data source. */
5316
5518
  type?: string;
5317
5519
  }
5520
+ interface GoogleCloudNotebooklmV1alphaSourceId {
5521
+ /** The id of the source. */
5522
+ id?: string;
5523
+ }
5524
+ interface GoogleCloudNotebooklmV1alphaUploadSourceFileRequest {
5525
+ /** Information about the file being uploaded. */
5526
+ blob?: GdataMedia;
5527
+ /** Media upload request metadata. */
5528
+ mediaRequestInfo?: ApiservingMediaRequestInfo;
5529
+ }
5530
+ interface GoogleCloudNotebooklmV1alphaUploadSourceFileResponse {
5531
+ /** Media upload response metadata. */
5532
+ mediaResponseInfo?: ApiservingMediaResponseInfo;
5533
+ /** The source id of the uploaded source. */
5534
+ sourceId?: GoogleCloudNotebooklmV1alphaSourceId;
5535
+ }
5318
5536
  interface GoogleLongrunningCancelOperationRequest {}
5319
5537
  interface GoogleLongrunningListOperationsResponse {
5320
5538
  /** The standard List next-page token. */
@@ -5429,6 +5647,66 @@ declare namespace gapi.client {
5429
5647
  /** Optional. IANA Time Zone Database version number. For example "2019a". */
5430
5648
  version?: string;
5431
5649
  }
5650
+ interface MediaResource {
5651
+ /** Uploads a file for Notebook LM to use. Creates a Source. */
5652
+ upload(request: {
5653
+ /** V1 error format. */
5654
+ '$.xgafv'?: string;
5655
+ /** OAuth access token. */
5656
+ access_token?: string;
5657
+ /** Data format for response. */
5658
+ alt?: string;
5659
+ /** JSONP */
5660
+ callback?: string;
5661
+ /** Selector specifying which fields to include in a partial response. */
5662
+ fields?: string;
5663
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
5664
+ key?: string;
5665
+ /** OAuth 2.0 token for the current user. */
5666
+ oauth_token?: string;
5667
+ /** Required. The parent resource where the sources will be created. Format: projects/{project}/locations/{location}/notebooks/{notebook} */
5668
+ parent: string;
5669
+ /** Returns response with indentations and line breaks. */
5670
+ prettyPrint?: boolean;
5671
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
5672
+ quotaUser?: string;
5673
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
5674
+ upload_protocol?: string;
5675
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
5676
+ uploadType?: string;
5677
+ /** Request body */
5678
+ resource: GoogleCloudNotebooklmV1alphaUploadSourceFileRequest;
5679
+ }): Request<GoogleCloudNotebooklmV1alphaUploadSourceFileResponse>;
5680
+ upload(
5681
+ request: {
5682
+ /** V1 error format. */
5683
+ '$.xgafv'?: string;
5684
+ /** OAuth access token. */
5685
+ access_token?: string;
5686
+ /** Data format for response. */
5687
+ alt?: string;
5688
+ /** JSONP */
5689
+ callback?: string;
5690
+ /** Selector specifying which fields to include in a partial response. */
5691
+ fields?: string;
5692
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
5693
+ key?: string;
5694
+ /** OAuth 2.0 token for the current user. */
5695
+ oauth_token?: string;
5696
+ /** Required. The parent resource where the sources will be created. Format: projects/{project}/locations/{location}/notebooks/{notebook} */
5697
+ parent: string;
5698
+ /** Returns response with indentations and line breaks. */
5699
+ prettyPrint?: boolean;
5700
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
5701
+ quotaUser?: string;
5702
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
5703
+ upload_protocol?: string;
5704
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
5705
+ uploadType?: string;
5706
+ },
5707
+ body: GoogleCloudNotebooklmV1alphaUploadSourceFileRequest,
5708
+ ): Request<GoogleCloudNotebooklmV1alphaUploadSourceFileResponse>;
5709
+ }
5432
5710
  interface CmekConfigsResource {
5433
5711
  /** De-provisions a CmekConfig. */
5434
5712
  delete(request?: {
@@ -17396,6 +17674,8 @@ declare namespace gapi.client {
17396
17674
  operations: OperationsResource;
17397
17675
  }
17398
17676
 
17677
+ const media: MediaResource;
17678
+
17399
17679
  const projects: ProjectsResource;
17400
17680
  }
17401
17681
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.discoveryengine-v1alpha",
3
- "version": "0.0.20250207",
3
+ "version": "0.0.20250211",
4
4
  "description": "TypeScript typings for Discovery Engine API v1alpha",
5
5
  "repository": {
6
6
  "type": "git",
package/readme.md CHANGED
@@ -69,6 +69,11 @@ gapi.auth.authorize(
69
69
  After that you can use Discovery Engine API resources: <!-- TODO: make this work for multiple namespaces -->
70
70
 
71
71
  ```typescript
72
+ /*
73
+ Uploads a file for Notebook LM to use. Creates a Source.
74
+ */
75
+ await gapi.client.discoveryengine.media.upload({parent: 'parent'});
76
+
72
77
  /*
73
78
  Gets a Project. Returns NOT_FOUND when the project is not yet created.
74
79
  */