@gigadrive/sdk 0.4.0 → 0.5.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/README.md +23 -0
- package/dist/index.d.mts +37 -1
- package/dist/index.d.ts +37 -1
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2212,6 +2212,23 @@ var OrganizationsResource = class extends BaseResource {
|
|
|
2212
2212
|
}
|
|
2213
2213
|
};
|
|
2214
2214
|
|
|
2215
|
+
// src/resources/sticky-sessions.ts
|
|
2216
|
+
var StickySessionsResource = class extends BaseResource {
|
|
2217
|
+
/**
|
|
2218
|
+
* Mints a signed URL for an opaque application key.
|
|
2219
|
+
*
|
|
2220
|
+
* Deployed Gigadrive workloads can call this with a zero-config
|
|
2221
|
+
* `GigadriveClient`; the platform injects `GIGADRIVE_CLIENT_ID` and
|
|
2222
|
+
* `GIGADRIVE_CLIENT_SECRET` using the SDK's existing credential chain.
|
|
2223
|
+
*/
|
|
2224
|
+
async createUrl(input) {
|
|
2225
|
+
return this.httpClient.post("/sticky-sessions/urls", {
|
|
2226
|
+
...input,
|
|
2227
|
+
method: input.method ?? "GET"
|
|
2228
|
+
});
|
|
2229
|
+
}
|
|
2230
|
+
};
|
|
2231
|
+
|
|
2215
2232
|
// src/client.ts
|
|
2216
2233
|
var DEFAULT_BASE_URL2 = "https://api.gigadrive.network";
|
|
2217
2234
|
var GigadriveClient = class {
|
|
@@ -2225,6 +2242,8 @@ var GigadriveClient = class {
|
|
|
2225
2242
|
aiGateway;
|
|
2226
2243
|
/** Application-scoped API key management (create, list, revoke). */
|
|
2227
2244
|
apiKeys;
|
|
2245
|
+
/** Signed URLs that keep related requests on one MicroVM instance. */
|
|
2246
|
+
stickySessions;
|
|
2228
2247
|
constructor(config = {}) {
|
|
2229
2248
|
const baseUrl = config.baseUrl ?? readEnv("GIGADRIVE_API_BASE_URL") ?? DEFAULT_BASE_URL2;
|
|
2230
2249
|
const fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis);
|
|
@@ -2236,6 +2255,7 @@ var GigadriveClient = class {
|
|
|
2236
2255
|
this.deployments = new DeploymentsResource(httpClient);
|
|
2237
2256
|
this.aiGateway = new AiGatewayResource(httpClient);
|
|
2238
2257
|
this.apiKeys = new ApiKeysResource(httpClient);
|
|
2258
|
+
this.stickySessions = new StickySessionsResource(httpClient);
|
|
2239
2259
|
}
|
|
2240
2260
|
};
|
|
2241
2261
|
|
|
@@ -2272,6 +2292,7 @@ export {
|
|
|
2272
2292
|
OrganizationMembersResource,
|
|
2273
2293
|
OrganizationProductsResource,
|
|
2274
2294
|
OrganizationsResource,
|
|
2295
|
+
StickySessionsResource,
|
|
2275
2296
|
StorageBucketsResource,
|
|
2276
2297
|
StorageObjectsResource,
|
|
2277
2298
|
StorageUploadSessionsResource,
|