@gigadrive/sdk 0.4.0 → 0.6.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 +96 -1
- package/dist/index.d.ts +96 -1
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1610,6 +1610,29 @@ var ApplicationsResource = class extends BaseResource {
|
|
|
1610
1610
|
query
|
|
1611
1611
|
});
|
|
1612
1612
|
}
|
|
1613
|
+
/**
|
|
1614
|
+
* Creates an application with production and preview environments.
|
|
1615
|
+
*
|
|
1616
|
+
* Requires the `network:applications:write` scope and access to the owning
|
|
1617
|
+
* organization. Application-, deployment-, and function-scoped tokens cannot
|
|
1618
|
+
* create applications.
|
|
1619
|
+
*
|
|
1620
|
+
* @param input - Ownership, display name, and optional repository layout.
|
|
1621
|
+
* @returns The persisted application plus the default production environment
|
|
1622
|
+
* slug, ready for an immediate deployment request.
|
|
1623
|
+
*
|
|
1624
|
+
* @example
|
|
1625
|
+
* ```ts
|
|
1626
|
+
* const app = await client.applications.create({
|
|
1627
|
+
* organizationId: 'org-id',
|
|
1628
|
+
* name: 'Next.js Storefront',
|
|
1629
|
+
* });
|
|
1630
|
+
* console.log(app.id, app.defaultEnvironmentSlug);
|
|
1631
|
+
* ```
|
|
1632
|
+
*/
|
|
1633
|
+
async create(input) {
|
|
1634
|
+
return this.httpClient.post("/applications", input);
|
|
1635
|
+
}
|
|
1613
1636
|
/**
|
|
1614
1637
|
* List the `*.gigadrive.app` hostnames for an application (production alias
|
|
1615
1638
|
* and per-branch aliases).
|
|
@@ -2212,6 +2235,23 @@ var OrganizationsResource = class extends BaseResource {
|
|
|
2212
2235
|
}
|
|
2213
2236
|
};
|
|
2214
2237
|
|
|
2238
|
+
// src/resources/sticky-sessions.ts
|
|
2239
|
+
var StickySessionsResource = class extends BaseResource {
|
|
2240
|
+
/**
|
|
2241
|
+
* Mints a signed URL for an opaque application key.
|
|
2242
|
+
*
|
|
2243
|
+
* Deployed Gigadrive workloads can call this with a zero-config
|
|
2244
|
+
* `GigadriveClient`; the platform injects `GIGADRIVE_CLIENT_ID` and
|
|
2245
|
+
* `GIGADRIVE_CLIENT_SECRET` using the SDK's existing credential chain.
|
|
2246
|
+
*/
|
|
2247
|
+
async createUrl(input) {
|
|
2248
|
+
return this.httpClient.post("/sticky-sessions/urls", {
|
|
2249
|
+
...input,
|
|
2250
|
+
method: input.method ?? "GET"
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
};
|
|
2254
|
+
|
|
2215
2255
|
// src/client.ts
|
|
2216
2256
|
var DEFAULT_BASE_URL2 = "https://api.gigadrive.network";
|
|
2217
2257
|
var GigadriveClient = class {
|
|
@@ -2225,6 +2265,8 @@ var GigadriveClient = class {
|
|
|
2225
2265
|
aiGateway;
|
|
2226
2266
|
/** Application-scoped API key management (create, list, revoke). */
|
|
2227
2267
|
apiKeys;
|
|
2268
|
+
/** Signed URLs that keep related requests on one MicroVM instance. */
|
|
2269
|
+
stickySessions;
|
|
2228
2270
|
constructor(config = {}) {
|
|
2229
2271
|
const baseUrl = config.baseUrl ?? readEnv("GIGADRIVE_API_BASE_URL") ?? DEFAULT_BASE_URL2;
|
|
2230
2272
|
const fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis);
|
|
@@ -2236,6 +2278,7 @@ var GigadriveClient = class {
|
|
|
2236
2278
|
this.deployments = new DeploymentsResource(httpClient);
|
|
2237
2279
|
this.aiGateway = new AiGatewayResource(httpClient);
|
|
2238
2280
|
this.apiKeys = new ApiKeysResource(httpClient);
|
|
2281
|
+
this.stickySessions = new StickySessionsResource(httpClient);
|
|
2239
2282
|
}
|
|
2240
2283
|
};
|
|
2241
2284
|
|
|
@@ -2272,6 +2315,7 @@ export {
|
|
|
2272
2315
|
OrganizationMembersResource,
|
|
2273
2316
|
OrganizationProductsResource,
|
|
2274
2317
|
OrganizationsResource,
|
|
2318
|
+
StickySessionsResource,
|
|
2275
2319
|
StorageBucketsResource,
|
|
2276
2320
|
StorageObjectsResource,
|
|
2277
2321
|
StorageUploadSessionsResource,
|