一键导入
authoring-remote-source
Remote sources are the API-specific bindings for pkg:data_layer.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Remote sources are the API-specific bindings for pkg:data_layer.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Understand how sources declare operation capabilities via supportedOperations and how SourceList respects them.
FirestoreAdminSource connects google_cloud_firestore for server-side Dart applications to a SourceList.
FirestoreSource seamlessly connects Cloud Firestore streams to a SourceList.
Perform untyped Firestore document merges using the raw method on Firestore sources.
Cached data is mapped uniquely per request hash (RequestDetails with specific filter and pagination), supporting a powerful request-based caching behavior.
The SourceList class manages the delegation of read/write attempts to various configured Sources, with a read-thru cache system prioritizing local Sources.
| name | authoring-remote-source |
| description | Remote sources are the API-specific bindings for pkg:data_layer. |
| metadata | {"last_modified":"Sat, 18 Apr 2026 1:52:50 GMT"} |
Remote sources use the actual real-live Internet to make network requests and read or write data.
Remote sources have two absolutely critical jobs when reading data:
filter to the request, andpagination to the request.A remote source which fails to do either of these jobs will result in undefined behavior when calling getItems. Consider the beginning of the RestSource.getItems implementation:
@override
Future<ReadListResult<T>> getItems(ReadListOperation<T> operation) async {
final Params params = <String, String>{};
// Add a specified filter as query parameters
if (operation.details.filter != null) {
params.addAll(operation.details.filter!.toParams());
}
// Add all specified pagination as query parameters
if (operation.details.pagination != null) {
params.addAll(operation.details.pagination!.toParams());
}
// Make the actual request
}
For SDKs that behave sufficiently differently from REST-based APIs, consider requiring a new method, like the FirestoreSource's required FirestoreFilter.apply method out of the pkg:data_layer_firestore package, which accepts a Firestore Query object, calls any filter functions as necessary, and returns the modified query.
Writing data via a Remote source involves implementing setItem and, optionally, setItems; though the behavior of setItems is so unpredictable as to not be offered by any Sources baked in to pkg:data_layer.
The most important job of setItem, specifically, is to honor RequestDetails.forceInsert for situations where records already contain an Id despite not yet existing in the database, and thus requiring an INSERT statement instead of an UPDATE statement. Or, for a Firebase-centric example, if the Document Id is known by the client despite not yet existing, which requires calling different methods on the CollectionReference class.