@brazosd/node 0.1.11 → 0.1.13

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 CHANGED
@@ -125,7 +125,10 @@ Each client keeps its own URL, credential provider and request configuration. Co
125
125
 
126
126
  SSO requires `@brazosd/node` 0.1.2 or later. `createSSO()` supports
127
127
  `org-user` (same-organization user API credentials) and
128
- `identity` (an identity JWT for users from any organization):
128
+ `identity` (an application-specific JWT). Identity login accepts any membership
129
+ by default. To limit it to the installation's organization, pass
130
+ `headers: { 'X-Brazosd-SSO-Org-Id': process.env.LEAWAN_ORG_ID }` to `createSSO`
131
+ after validating the runtime organization ID.
129
132
 
130
133
  ```js
131
134
  import { createSSO } from '@brazosd/node';
package/browser.d.ts CHANGED
@@ -762,12 +762,17 @@ type AppendAgentSessionEventRequest = {
762
762
  */
763
763
  skipPersistent?: boolean;
764
764
  };
765
+ type AuthorizeDockSSORequest = {
766
+ installationId: string;
767
+ orgId: number;
768
+ };
765
769
  type SSOMode = "org-user" | "identity";
766
770
  type AuthorizeSSORequest = {
767
771
  mode: SSOMode;
768
772
  orgId: number;
769
773
  };
770
774
  type BillingCloudDriveKind = "user.drive" | "org.drive" | "org-public.drive" | "public.drive" | "channel.drive" | "agent-repo.drive" | "other";
775
+ type BillingCloudDriveUsageKind = "org-user.drive" | "service-user.drive" | "org.drive" | "org-public.drive" | "public.drive" | "channel.drive" | "agent-repo.drive" | "other";
771
776
  type BillingCredit = {
772
777
  createdAt: string;
773
778
  earnedAmountMicroyuans: number;
@@ -1220,6 +1225,24 @@ type CloudDriveCapacitySummary = {
1220
1225
  */
1221
1226
  totalBytes?: number;
1222
1227
  };
1228
+ type CloudDriveDailyCost = {
1229
+ /**
1230
+ * OSS requests and public downloads in decimal microyuans before settlement rounding.
1231
+ */
1232
+ accessMicroyuans: string;
1233
+ /**
1234
+ * Whether the day's final review or settlement is still pending.
1235
+ */
1236
+ provisional: boolean;
1237
+ /**
1238
+ * Storage fee in decimal microyuans before settlement rounding.
1239
+ */
1240
+ storageMicroyuans: string;
1241
+ /**
1242
+ * UTC usage date (YYYY-MM-DD)
1243
+ */
1244
+ usageDate: string;
1245
+ };
1223
1246
  type CloudDriveFnode = {
1224
1247
  /**
1225
1248
  * MIME type of the file, when known. Null for directories.
@@ -1286,6 +1309,38 @@ type CloudDriveSettings = {
1286
1309
  */
1287
1310
  trashCleanupIntervalDays?: number | null;
1288
1311
  };
1312
+ type CloudDriveStorageHour = {
1313
+ /**
1314
+ * Organization closing bytes. Present for captured and sampled hours, including observed zero.
1315
+ */
1316
+ closingBytes?: number;
1317
+ /**
1318
+ * Start of the UTC hour
1319
+ */
1320
+ hourStart: string;
1321
+ status: "pending" | "captured" | "sampled" | "waived";
1322
+ /**
1323
+ * Reason for a waived hour (missing_snapshot at final review).
1324
+ */
1325
+ waiverReason?: string;
1326
+ };
1327
+ type CloudDriveStorageCoverage = {
1328
+ /**
1329
+ * Exclusive end of continuous storage settlement from activation (including explicit waivers), capped at the selected day's end. Omitted when there are no eligible hours.
1330
+ */
1331
+ confirmedThrough?: string;
1332
+ hours: Array<CloudDriveStorageHour>;
1333
+ };
1334
+ type CloudDriveUsagePage = {
1335
+ /**
1336
+ * Drive usage with separate organization and service user drive kinds.
1337
+ */
1338
+ items: Array<CloudDriveCapacity>;
1339
+ /**
1340
+ * Omitted when this is the last page.
1341
+ */
1342
+ nextCursor?: string;
1343
+ };
1289
1344
  type CloudSandbox = {
1290
1345
  billedAmountMicroyuans: number;
1291
1346
  deviceKey: string;
@@ -3511,6 +3566,9 @@ type SSOGrant = {
3511
3566
  type SSORequest = {
3512
3567
  appId?: string;
3513
3568
  appName: string;
3569
+ /**
3570
+ * Organization that owns the deployed application.
3571
+ */
3514
3572
  appOrgId?: number;
3515
3573
  /**
3516
3574
  * Local CLI callback containing only the request state and access_denied.
@@ -3524,6 +3582,10 @@ type SSORequest = {
3524
3582
  id: string;
3525
3583
  mode: SSOMode;
3526
3584
  redirectUri: string;
3585
+ /**
3586
+ * The only organization that can authorize this request, when restricted.
3587
+ */
3588
+ requiredOrgId?: number;
3527
3589
  /**
3528
3590
  * Cloud permissions requested by the CLI.
3529
3591
  */
@@ -4187,7 +4249,7 @@ declare class DefaultService {
4187
4249
  }): CancelablePromise<void>;
4188
4250
  /**
4189
4251
  * Authorize using a human account login
4190
- * Uses an account access token, never an application or organization token. The selected org must contain the account; org-user mode additionally requires the application's org. Produces a single-use authorization code, not API credentials.
4252
+ * Requires a human account access token and an active membership in the selected organization. When the request specifies requiredOrgId, the selected organization must match. Returns a one-time authorization code.
4191
4253
  * @returns SSOAuthorization Verified callback URL containing code and state
4192
4254
  * @throws ApiError
4193
4255
  */
@@ -4195,6 +4257,16 @@ declare class DefaultService {
4195
4257
  requestId: string;
4196
4258
  requestBody: AuthorizeSSORequest;
4197
4259
  }): CancelablePromise<SSOAuthorization>;
4260
+ /**
4261
+ * Sign in to the installed application opened in the desktop Dock
4262
+ * Uses the console's account access token. The member must be able to open the installation in the selected organization, and that organization must satisfy the request's requiredOrgId when present. Only an identity request from that installation's deployed application is eligible.
4263
+ * @returns SSOAuthorization Registered callback URL with a one-time authorization code and state
4264
+ * @throws ApiError
4265
+ */
4266
+ authorizeDockSsoRequest({ requestId, requestBody, }: {
4267
+ requestId: string;
4268
+ requestBody: AuthorizeDockSSORequest;
4269
+ }): CancelablePromise<SSOAuthorization>;
4198
4270
  /**
4199
4271
  * Remove an agent contact list member
4200
4272
  * Remove a delegation target from the specified agent within the current org
@@ -5229,6 +5301,17 @@ declare class DefaultService {
5229
5301
  * @throws ApiError
5230
5302
  */
5231
5303
  getBillingCloudDriveCapacitySummary(): CancelablePromise<CloudDriveCapacitySummary>;
5304
+ /**
5305
+ * List cloud drive storage and access costs by UTC usage date for the current organization
5306
+ * @returns CloudDriveDailyCost Costs for billable dates in ascending order, priced from metered usage.
5307
+ * @throws ApiError
5308
+ */
5309
+ listBillingCloudDriveDailyCosts({ days, }: {
5310
+ /**
5311
+ * Number of UTC days including today.
5312
+ */
5313
+ days?: number;
5314
+ }): CancelablePromise<Array<CloudDriveDailyCost>>;
5232
5315
  /**
5233
5316
  * Read the current organization's cloud drive invoice for one UTC issue date
5234
5317
  * @returns CloudDriveInvoiceItem Incremental charges and quantities on this invoice, including late adjustments
@@ -5237,6 +5320,34 @@ declare class DefaultService {
5237
5320
  getBillingCloudDriveInvoice({ invoiceDay, }: {
5238
5321
  invoiceDay: string;
5239
5322
  }): CancelablePromise<Array<CloudDriveInvoiceItem>>;
5323
+ /**
5324
+ * Get hourly storage metering for the authenticated organization on a UTC usage day
5325
+ * @returns CloudDriveStorageCoverage Completed hour intervals since activation and organization creation, including missing samples
5326
+ * @throws ApiError
5327
+ */
5328
+ getBillingCloudDriveStorageCoverage({ usageDay, }: {
5329
+ usageDay: string;
5330
+ }): CancelablePromise<CloudDriveStorageCoverage>;
5331
+ /**
5332
+ * List cloud drive usage for a UTC day in descending access fee order
5333
+ * @returns CloudDriveUsagePage A page sorted by descending access fee and ascending drive root ID for equal fees
5334
+ * @throws ApiError
5335
+ */
5336
+ listBillingCloudDriveUsage({ cursor, limit, usageDay, driveKind, }: {
5337
+ /**
5338
+ * Next cursor from the preceding page for the same day and drive kind.
5339
+ */
5340
+ cursor?: string;
5341
+ limit?: number;
5342
+ /**
5343
+ * UTC usage day. Defaults to today.
5344
+ */
5345
+ usageDay?: string;
5346
+ /**
5347
+ * Omit to include all drives.
5348
+ */
5349
+ driveKind?: BillingCloudDriveUsageKind;
5350
+ }): CancelablePromise<CloudDriveUsagePage>;
5240
5351
  /**
5241
5352
  * Get billing credits
5242
5353
  * Get the current organization's credit balances, lifetime spending, and invoiced and available invoice amounts.
@@ -7353,8 +7464,12 @@ declare class DefaultService {
7353
7464
  * @returns SSORequest Login request
7354
7465
  * @throws ApiError
7355
7466
  */
7356
- createSsoRequest({ requestBody, }: {
7467
+ createSsoRequest({ requestBody, xBrazosdSsoOrgId, }: {
7357
7468
  requestBody: CreateSSORequest;
7469
+ /**
7470
+ * Restrict this login to a member of this organization. An org-user application request always requires the application's own organization.
7471
+ */
7472
+ xBrazosdSsoOrgId?: number;
7358
7473
  }): CancelablePromise<SSORequest>;
7359
7474
  /**
7360
7475
  * Preview a short-lived SSO request
@@ -7757,13 +7872,21 @@ type App = {
7757
7872
  enabled: boolean;
7758
7873
  state: string;
7759
7874
  revisionId?: string;
7760
- runtime: "nodejs";
7875
+ runtime: "nodejs" | "linux";
7761
7876
  /**
7762
7877
  * Application listen port; 8081 is reserved for the runtime.
7763
7878
  */
7764
7879
  port: number;
7765
7880
  vcpu: VCPU;
7766
7881
  memoryGiB: MemoryGiB;
7882
+ /**
7883
+ * Executable followed by literal arguments. Working directory is the bundle root (/srv/app). Defaults to ["node","server.js"] or ["./server"].
7884
+ */
7885
+ command: Array<string>;
7886
+ /**
7887
+ * Legacy Node.js script path relative to the bundle root. Use command for new configurations.
7888
+ * @deprecated
7889
+ */
7767
7890
  entrypoint: string;
7768
7891
  healthPath: string;
7769
7892
  /**
@@ -7787,8 +7910,8 @@ type App = {
7787
7910
  type AppCredentialBindingInput = {
7788
7911
  credentialId: string;
7789
7912
  };
7790
- type NodeMemoryGiB = 1;
7791
- type NodeVCPU = 0.5;
7913
+ type NodeMemoryGiB = 0.5 | 1;
7914
+ type NodeVCPU = 0.25 | 0.5;
7792
7915
  type AppInput = {
7793
7916
  /**
7794
7917
  * Use a verified root domain from this organization. Omit to use the organization's default root, or just the platform domain when no default is set. The platform URL is always retained.
@@ -7807,9 +7930,17 @@ type AppInput = {
7807
7930
  */
7808
7931
  serviceUserId?: (string | number);
7809
7932
  name: string;
7933
+ /**
7934
+ * Executable followed by literal arguments. Working directory is the bundle root (/srv/app). Defaults to ["node","server.js"] or ["./server"].
7935
+ */
7936
+ command?: Array<string>;
7937
+ /**
7938
+ * Legacy Node.js script path relative to the bundle root. Use command for new configurations.
7939
+ * @deprecated
7940
+ */
7810
7941
  entrypoint?: string;
7811
7942
  healthPath?: string;
7812
- runtime?: "nodejs";
7943
+ runtime?: "nodejs" | "linux";
7813
7944
  /**
7814
7945
  * Application listen port; 8081 is reserved for the runtime.
7815
7946
  */
@@ -7908,13 +8039,21 @@ type AppMetrics = {
7908
8039
  };
7909
8040
  type AppSettings = {
7910
8041
  enabled?: boolean;
7911
- runtime?: "nodejs";
8042
+ runtime?: "nodejs" | "linux";
7912
8043
  /**
7913
8044
  * Application listen port; 8081 is reserved for the runtime.
7914
8045
  */
7915
8046
  port?: number;
7916
8047
  vcpu?: NodeVCPU;
7917
8048
  memoryGiB?: NodeMemoryGiB;
8049
+ /**
8050
+ * Executable followed by literal arguments. Working directory is the bundle root (/srv/app). Defaults to ["node","server.js"] or ["./server"].
8051
+ */
8052
+ command?: Array<string>;
8053
+ /**
8054
+ * Legacy Node.js script path relative to the bundle root. Use command for new configurations.
8055
+ * @deprecated
8056
+ */
7918
8057
  entrypoint?: string;
7919
8058
  healthPath?: string;
7920
8059
  /**
@@ -7942,7 +8081,7 @@ type AppSummary = {
7942
8081
  url: string;
7943
8082
  enabled: boolean;
7944
8083
  state: string;
7945
- runtime: "nodejs";
8084
+ runtime: "nodejs" | "linux";
7946
8085
  vcpu: VCPU;
7947
8086
  memoryGiB: MemoryGiB;
7948
8087
  serviceUserId: number;
@@ -8192,7 +8331,7 @@ type RootDomainSettings = {
8192
8331
  };
8193
8332
  type TransactionalEvent = {
8194
8333
  id: string;
8195
- state: "pending" | "delivering" | "retrying" | "delivered" | "failed";
8334
+ state: "pending" | "delivering" | "retrying" | "delivered" | "failed" | "cancelled";
8196
8335
  attempts: number;
8197
8336
  createdAt: string;
8198
8337
  nextAttemptAt?: string;
@@ -8782,11 +8921,20 @@ declare class DefaultService$2 {
8782
8921
  };
8783
8922
  }): CancelablePromise<DeploymentPackage>;
8784
8923
  /**
8785
- * @returns Deployment Success
8924
+ * List a function's deployments from newest to oldest
8925
+ * @returns Deployment Deployments ordered by creation time and ID, both descending
8786
8926
  * @throws ApiError
8787
8927
  */
8788
- listDeployments({ id, }: {
8928
+ listDeployments({ id, limit, after, }: {
8789
8929
  id: string;
8930
+ /**
8931
+ * Maximum number of deployments to return.
8932
+ */
8933
+ limit?: number;
8934
+ /**
8935
+ * ID of the last deployment shown from the previous page of this function. Starts after that deployment.
8936
+ */
8937
+ after?: string;
8790
8938
  }): CancelablePromise<Array<Deployment>>;
8791
8939
  /**
8792
8940
  * Deploy a package to the target cloud function
package/browser.js CHANGED
@@ -826,7 +826,7 @@ var DefaultService = class {
826
826
  }
827
827
  /**
828
828
  * Authorize using a human account login
829
- * Uses an account access token, never an application or organization token. The selected org must contain the account; org-user mode additionally requires the application's org. Produces a single-use authorization code, not API credentials.
829
+ * Requires a human account access token and an active membership in the selected organization. When the request specifies requiredOrgId, the selected organization must match. Returns a one-time authorization code.
830
830
  * @returns SSOAuthorization Verified callback URL containing code and state
831
831
  * @throws ApiError
832
832
  */
@@ -844,6 +844,26 @@ var DefaultService = class {
844
844
  mediaType: "application/json"
845
845
  });
846
846
  }
847
+ /**
848
+ * Sign in to the installed application opened in the desktop Dock
849
+ * Uses the console's account access token. The member must be able to open the installation in the selected organization, and that organization must satisfy the request's requiredOrgId when present. Only an identity request from that installation's deployed application is eligible.
850
+ * @returns SSOAuthorization Registered callback URL with a one-time authorization code and state
851
+ * @throws ApiError
852
+ */
853
+ authorizeDockSsoRequest({
854
+ requestId,
855
+ requestBody
856
+ }) {
857
+ return this.httpRequest.request({
858
+ method: "POST",
859
+ url: "/account/sso/requests/{requestId}/authorize-dock",
860
+ path: {
861
+ "requestId": requestId
862
+ },
863
+ body: requestBody,
864
+ mediaType: "application/json"
865
+ });
866
+ }
847
867
  /**
848
868
  * Remove an agent contact list member
849
869
  * Remove a delegation target from the specified agent within the current org
@@ -2863,6 +2883,25 @@ var DefaultService = class {
2863
2883
  url: "/billing/cloud-drive/capacity-summary"
2864
2884
  });
2865
2885
  }
2886
+ /**
2887
+ * List cloud drive storage and access costs by UTC usage date for the current organization
2888
+ * @returns CloudDriveDailyCost Costs for billable dates in ascending order, priced from metered usage.
2889
+ * @throws ApiError
2890
+ */
2891
+ listBillingCloudDriveDailyCosts({
2892
+ days = 30
2893
+ }) {
2894
+ return this.httpRequest.request({
2895
+ method: "GET",
2896
+ url: "/billing/cloud-drive/daily-costs",
2897
+ query: {
2898
+ "days": days
2899
+ },
2900
+ errors: {
2901
+ 400: `Invalid number of days`
2902
+ }
2903
+ });
2904
+ }
2866
2905
  /**
2867
2906
  * Read the current organization's cloud drive invoice for one UTC issue date
2868
2907
  * @returns CloudDriveInvoiceItem Incremental charges and quantities on this invoice, including late adjustments
@@ -2879,6 +2918,50 @@ var DefaultService = class {
2879
2918
  }
2880
2919
  });
2881
2920
  }
2921
+ /**
2922
+ * Get hourly storage metering for the authenticated organization on a UTC usage day
2923
+ * @returns CloudDriveStorageCoverage Completed hour intervals since activation and organization creation, including missing samples
2924
+ * @throws ApiError
2925
+ */
2926
+ getBillingCloudDriveStorageCoverage({
2927
+ usageDay
2928
+ }) {
2929
+ return this.httpRequest.request({
2930
+ method: "GET",
2931
+ url: "/billing/cloud-drive/storage-coverage/{usageDay}",
2932
+ path: {
2933
+ "usageDay": usageDay
2934
+ },
2935
+ errors: {
2936
+ 400: `Invalid UTC usage date`
2937
+ }
2938
+ });
2939
+ }
2940
+ /**
2941
+ * List cloud drive usage for a UTC day in descending access fee order
2942
+ * @returns CloudDriveUsagePage A page sorted by descending access fee and ascending drive root ID for equal fees
2943
+ * @throws ApiError
2944
+ */
2945
+ listBillingCloudDriveUsage({
2946
+ cursor,
2947
+ limit = 50,
2948
+ usageDay,
2949
+ driveKind
2950
+ }) {
2951
+ return this.httpRequest.request({
2952
+ method: "GET",
2953
+ url: "/billing/cloud-drive/usage",
2954
+ query: {
2955
+ "cursor": cursor,
2956
+ "limit": limit,
2957
+ "usageDay": usageDay,
2958
+ "driveKind": driveKind
2959
+ },
2960
+ errors: {
2961
+ 400: `Invalid usage day, drive kind or cursor`
2962
+ }
2963
+ });
2964
+ }
2882
2965
  /**
2883
2966
  * Get billing credits
2884
2967
  * Get the current organization's credit balances, lifetime spending, and invoiced and available invoice amounts.
@@ -7258,11 +7341,15 @@ var DefaultService = class {
7258
7341
  * @throws ApiError
7259
7342
  */
7260
7343
  createSsoRequest({
7261
- requestBody
7344
+ requestBody,
7345
+ xBrazosdSsoOrgId
7262
7346
  }) {
7263
7347
  return this.httpRequest.request({
7264
7348
  method: "POST",
7265
7349
  url: "/sso/requests",
7350
+ headers: {
7351
+ "X-Brazosd-SSO-Org-Id": xBrazosdSsoOrgId
7352
+ },
7266
7353
  body: requestBody,
7267
7354
  mediaType: "application/json"
7268
7355
  });
@@ -9042,11 +9129,14 @@ var DefaultService3 = class {
9042
9129
  });
9043
9130
  }
9044
9131
  /**
9045
- * @returns Deployment Success
9132
+ * List a function's deployments from newest to oldest
9133
+ * @returns Deployment Deployments ordered by creation time and ID, both descending
9046
9134
  * @throws ApiError
9047
9135
  */
9048
9136
  listDeployments({
9049
- id
9137
+ id,
9138
+ limit = 100,
9139
+ after
9050
9140
  }) {
9051
9141
  return this.httpRequest.request({
9052
9142
  method: "GET",
@@ -9054,6 +9144,10 @@ var DefaultService3 = class {
9054
9144
  path: {
9055
9145
  "id": id
9056
9146
  },
9147
+ query: {
9148
+ "limit": limit,
9149
+ "after": after
9150
+ },
9057
9151
  errors: {
9058
9152
  400: `Invalid input`,
9059
9153
  401: `Unauthorized`,
@@ -9389,6 +9483,13 @@ var operations = {
9389
9483
  "200": "json"
9390
9484
  }
9391
9485
  },
9486
+ "POST /account/sso/requests/{requestId}/authorize-dock": {
9487
+ "authenticated": true,
9488
+ "redirect": false,
9489
+ "responses": {
9490
+ "200": "json"
9491
+ }
9492
+ },
9392
9493
  "DELETE /agent-contact-list/{agentId}": {
9393
9494
  "authenticated": true,
9394
9495
  "redirect": false,
@@ -10223,6 +10324,14 @@ var operations = {
10223
10324
  "200": "json"
10224
10325
  }
10225
10326
  },
10327
+ "GET /billing/cloud-drive/daily-costs": {
10328
+ "authenticated": true,
10329
+ "redirect": false,
10330
+ "responses": {
10331
+ "200": "json",
10332
+ "400": "void"
10333
+ }
10334
+ },
10226
10335
  "GET /billing/cloud-drive/invoices/{invoiceDay}": {
10227
10336
  "authenticated": true,
10228
10337
  "redirect": false,
@@ -10230,6 +10339,22 @@ var operations = {
10230
10339
  "200": "json"
10231
10340
  }
10232
10341
  },
10342
+ "GET /billing/cloud-drive/storage-coverage/{usageDay}": {
10343
+ "authenticated": true,
10344
+ "redirect": false,
10345
+ "responses": {
10346
+ "200": "json",
10347
+ "400": "void"
10348
+ }
10349
+ },
10350
+ "GET /billing/cloud-drive/usage": {
10351
+ "authenticated": true,
10352
+ "redirect": false,
10353
+ "responses": {
10354
+ "200": "json",
10355
+ "400": "void"
10356
+ }
10357
+ },
10233
10358
  "GET /billing/credits": {
10234
10359
  "authenticated": true,
10235
10360
  "redirect": false,
package/index.d.ts CHANGED
@@ -764,12 +764,17 @@ type AppendAgentSessionEventRequest = {
764
764
  */
765
765
  skipPersistent?: boolean;
766
766
  };
767
+ type AuthorizeDockSSORequest = {
768
+ installationId: string;
769
+ orgId: number;
770
+ };
767
771
  export type SSOMode = "org-user" | "identity";
768
772
  type AuthorizeSSORequest = {
769
773
  mode: SSOMode;
770
774
  orgId: number;
771
775
  };
772
776
  type BillingCloudDriveKind = "user.drive" | "org.drive" | "org-public.drive" | "public.drive" | "channel.drive" | "agent-repo.drive" | "other";
777
+ type BillingCloudDriveUsageKind = "org-user.drive" | "service-user.drive" | "org.drive" | "org-public.drive" | "public.drive" | "channel.drive" | "agent-repo.drive" | "other";
773
778
  type BillingCredit = {
774
779
  createdAt: string;
775
780
  earnedAmountMicroyuans: number;
@@ -1222,6 +1227,24 @@ type CloudDriveCapacitySummary = {
1222
1227
  */
1223
1228
  totalBytes?: number;
1224
1229
  };
1230
+ type CloudDriveDailyCost = {
1231
+ /**
1232
+ * OSS requests and public downloads in decimal microyuans before settlement rounding.
1233
+ */
1234
+ accessMicroyuans: string;
1235
+ /**
1236
+ * Whether the day's final review or settlement is still pending.
1237
+ */
1238
+ provisional: boolean;
1239
+ /**
1240
+ * Storage fee in decimal microyuans before settlement rounding.
1241
+ */
1242
+ storageMicroyuans: string;
1243
+ /**
1244
+ * UTC usage date (YYYY-MM-DD)
1245
+ */
1246
+ usageDate: string;
1247
+ };
1225
1248
  type CloudDriveFnode = {
1226
1249
  /**
1227
1250
  * MIME type of the file, when known. Null for directories.
@@ -1288,6 +1311,38 @@ type CloudDriveSettings = {
1288
1311
  */
1289
1312
  trashCleanupIntervalDays?: number | null;
1290
1313
  };
1314
+ type CloudDriveStorageHour = {
1315
+ /**
1316
+ * Organization closing bytes. Present for captured and sampled hours, including observed zero.
1317
+ */
1318
+ closingBytes?: number;
1319
+ /**
1320
+ * Start of the UTC hour
1321
+ */
1322
+ hourStart: string;
1323
+ status: "pending" | "captured" | "sampled" | "waived";
1324
+ /**
1325
+ * Reason for a waived hour (missing_snapshot at final review).
1326
+ */
1327
+ waiverReason?: string;
1328
+ };
1329
+ type CloudDriveStorageCoverage = {
1330
+ /**
1331
+ * Exclusive end of continuous storage settlement from activation (including explicit waivers), capped at the selected day's end. Omitted when there are no eligible hours.
1332
+ */
1333
+ confirmedThrough?: string;
1334
+ hours: Array<CloudDriveStorageHour>;
1335
+ };
1336
+ type CloudDriveUsagePage = {
1337
+ /**
1338
+ * Drive usage with separate organization and service user drive kinds.
1339
+ */
1340
+ items: Array<CloudDriveCapacity>;
1341
+ /**
1342
+ * Omitted when this is the last page.
1343
+ */
1344
+ nextCursor?: string;
1345
+ };
1291
1346
  type CloudSandbox = {
1292
1347
  billedAmountMicroyuans: number;
1293
1348
  deviceKey: string;
@@ -3513,6 +3568,9 @@ type SSOGrant = {
3513
3568
  type SSORequest = {
3514
3569
  appId?: string;
3515
3570
  appName: string;
3571
+ /**
3572
+ * Organization that owns the deployed application.
3573
+ */
3516
3574
  appOrgId?: number;
3517
3575
  /**
3518
3576
  * Local CLI callback containing only the request state and access_denied.
@@ -3526,6 +3584,10 @@ type SSORequest = {
3526
3584
  id: string;
3527
3585
  mode: SSOMode;
3528
3586
  redirectUri: string;
3587
+ /**
3588
+ * The only organization that can authorize this request, when restricted.
3589
+ */
3590
+ requiredOrgId?: number;
3529
3591
  /**
3530
3592
  * Cloud permissions requested by the CLI.
3531
3593
  */
@@ -4189,7 +4251,7 @@ declare class DefaultService {
4189
4251
  }): CancelablePromise<void>;
4190
4252
  /**
4191
4253
  * Authorize using a human account login
4192
- * Uses an account access token, never an application or organization token. The selected org must contain the account; org-user mode additionally requires the application's org. Produces a single-use authorization code, not API credentials.
4254
+ * Requires a human account access token and an active membership in the selected organization. When the request specifies requiredOrgId, the selected organization must match. Returns a one-time authorization code.
4193
4255
  * @returns SSOAuthorization Verified callback URL containing code and state
4194
4256
  * @throws ApiError
4195
4257
  */
@@ -4197,6 +4259,16 @@ declare class DefaultService {
4197
4259
  requestId: string;
4198
4260
  requestBody: AuthorizeSSORequest;
4199
4261
  }): CancelablePromise<SSOAuthorization>;
4262
+ /**
4263
+ * Sign in to the installed application opened in the desktop Dock
4264
+ * Uses the console's account access token. The member must be able to open the installation in the selected organization, and that organization must satisfy the request's requiredOrgId when present. Only an identity request from that installation's deployed application is eligible.
4265
+ * @returns SSOAuthorization Registered callback URL with a one-time authorization code and state
4266
+ * @throws ApiError
4267
+ */
4268
+ authorizeDockSsoRequest({ requestId, requestBody, }: {
4269
+ requestId: string;
4270
+ requestBody: AuthorizeDockSSORequest;
4271
+ }): CancelablePromise<SSOAuthorization>;
4200
4272
  /**
4201
4273
  * Remove an agent contact list member
4202
4274
  * Remove a delegation target from the specified agent within the current org
@@ -5231,6 +5303,17 @@ declare class DefaultService {
5231
5303
  * @throws ApiError
5232
5304
  */
5233
5305
  getBillingCloudDriveCapacitySummary(): CancelablePromise<CloudDriveCapacitySummary>;
5306
+ /**
5307
+ * List cloud drive storage and access costs by UTC usage date for the current organization
5308
+ * @returns CloudDriveDailyCost Costs for billable dates in ascending order, priced from metered usage.
5309
+ * @throws ApiError
5310
+ */
5311
+ listBillingCloudDriveDailyCosts({ days, }: {
5312
+ /**
5313
+ * Number of UTC days including today.
5314
+ */
5315
+ days?: number;
5316
+ }): CancelablePromise<Array<CloudDriveDailyCost>>;
5234
5317
  /**
5235
5318
  * Read the current organization's cloud drive invoice for one UTC issue date
5236
5319
  * @returns CloudDriveInvoiceItem Incremental charges and quantities on this invoice, including late adjustments
@@ -5239,6 +5322,34 @@ declare class DefaultService {
5239
5322
  getBillingCloudDriveInvoice({ invoiceDay, }: {
5240
5323
  invoiceDay: string;
5241
5324
  }): CancelablePromise<Array<CloudDriveInvoiceItem>>;
5325
+ /**
5326
+ * Get hourly storage metering for the authenticated organization on a UTC usage day
5327
+ * @returns CloudDriveStorageCoverage Completed hour intervals since activation and organization creation, including missing samples
5328
+ * @throws ApiError
5329
+ */
5330
+ getBillingCloudDriveStorageCoverage({ usageDay, }: {
5331
+ usageDay: string;
5332
+ }): CancelablePromise<CloudDriveStorageCoverage>;
5333
+ /**
5334
+ * List cloud drive usage for a UTC day in descending access fee order
5335
+ * @returns CloudDriveUsagePage A page sorted by descending access fee and ascending drive root ID for equal fees
5336
+ * @throws ApiError
5337
+ */
5338
+ listBillingCloudDriveUsage({ cursor, limit, usageDay, driveKind, }: {
5339
+ /**
5340
+ * Next cursor from the preceding page for the same day and drive kind.
5341
+ */
5342
+ cursor?: string;
5343
+ limit?: number;
5344
+ /**
5345
+ * UTC usage day. Defaults to today.
5346
+ */
5347
+ usageDay?: string;
5348
+ /**
5349
+ * Omit to include all drives.
5350
+ */
5351
+ driveKind?: BillingCloudDriveUsageKind;
5352
+ }): CancelablePromise<CloudDriveUsagePage>;
5242
5353
  /**
5243
5354
  * Get billing credits
5244
5355
  * Get the current organization's credit balances, lifetime spending, and invoiced and available invoice amounts.
@@ -7355,8 +7466,12 @@ declare class DefaultService {
7355
7466
  * @returns SSORequest Login request
7356
7467
  * @throws ApiError
7357
7468
  */
7358
- createSsoRequest({ requestBody, }: {
7469
+ createSsoRequest({ requestBody, xBrazosdSsoOrgId, }: {
7359
7470
  requestBody: CreateSSORequest;
7471
+ /**
7472
+ * Restrict this login to a member of this organization. An org-user application request always requires the application's own organization.
7473
+ */
7474
+ xBrazosdSsoOrgId?: number;
7360
7475
  }): CancelablePromise<SSORequest>;
7361
7476
  /**
7362
7477
  * Preview a short-lived SSO request
@@ -7759,13 +7874,21 @@ type App = {
7759
7874
  enabled: boolean;
7760
7875
  state: string;
7761
7876
  revisionId?: string;
7762
- runtime: "nodejs";
7877
+ runtime: "nodejs" | "linux";
7763
7878
  /**
7764
7879
  * Application listen port; 8081 is reserved for the runtime.
7765
7880
  */
7766
7881
  port: number;
7767
7882
  vcpu: VCPU;
7768
7883
  memoryGiB: MemoryGiB;
7884
+ /**
7885
+ * Executable followed by literal arguments. Working directory is the bundle root (/srv/app). Defaults to ["node","server.js"] or ["./server"].
7886
+ */
7887
+ command: Array<string>;
7888
+ /**
7889
+ * Legacy Node.js script path relative to the bundle root. Use command for new configurations.
7890
+ * @deprecated
7891
+ */
7769
7892
  entrypoint: string;
7770
7893
  healthPath: string;
7771
7894
  /**
@@ -7789,8 +7912,8 @@ type App = {
7789
7912
  type AppCredentialBindingInput = {
7790
7913
  credentialId: string;
7791
7914
  };
7792
- type NodeMemoryGiB = 1;
7793
- type NodeVCPU = 0.5;
7915
+ type NodeMemoryGiB = 0.5 | 1;
7916
+ type NodeVCPU = 0.25 | 0.5;
7794
7917
  type AppInput = {
7795
7918
  /**
7796
7919
  * Use a verified root domain from this organization. Omit to use the organization's default root, or just the platform domain when no default is set. The platform URL is always retained.
@@ -7809,9 +7932,17 @@ type AppInput = {
7809
7932
  */
7810
7933
  serviceUserId?: (string | number);
7811
7934
  name: string;
7935
+ /**
7936
+ * Executable followed by literal arguments. Working directory is the bundle root (/srv/app). Defaults to ["node","server.js"] or ["./server"].
7937
+ */
7938
+ command?: Array<string>;
7939
+ /**
7940
+ * Legacy Node.js script path relative to the bundle root. Use command for new configurations.
7941
+ * @deprecated
7942
+ */
7812
7943
  entrypoint?: string;
7813
7944
  healthPath?: string;
7814
- runtime?: "nodejs";
7945
+ runtime?: "nodejs" | "linux";
7815
7946
  /**
7816
7947
  * Application listen port; 8081 is reserved for the runtime.
7817
7948
  */
@@ -7910,13 +8041,21 @@ type AppMetrics = {
7910
8041
  };
7911
8042
  type AppSettings = {
7912
8043
  enabled?: boolean;
7913
- runtime?: "nodejs";
8044
+ runtime?: "nodejs" | "linux";
7914
8045
  /**
7915
8046
  * Application listen port; 8081 is reserved for the runtime.
7916
8047
  */
7917
8048
  port?: number;
7918
8049
  vcpu?: NodeVCPU;
7919
8050
  memoryGiB?: NodeMemoryGiB;
8051
+ /**
8052
+ * Executable followed by literal arguments. Working directory is the bundle root (/srv/app). Defaults to ["node","server.js"] or ["./server"].
8053
+ */
8054
+ command?: Array<string>;
8055
+ /**
8056
+ * Legacy Node.js script path relative to the bundle root. Use command for new configurations.
8057
+ * @deprecated
8058
+ */
7920
8059
  entrypoint?: string;
7921
8060
  healthPath?: string;
7922
8061
  /**
@@ -7944,7 +8083,7 @@ type AppSummary = {
7944
8083
  url: string;
7945
8084
  enabled: boolean;
7946
8085
  state: string;
7947
- runtime: "nodejs";
8086
+ runtime: "nodejs" | "linux";
7948
8087
  vcpu: VCPU;
7949
8088
  memoryGiB: MemoryGiB;
7950
8089
  serviceUserId: number;
@@ -8194,7 +8333,7 @@ type RootDomainSettings = {
8194
8333
  };
8195
8334
  type TransactionalEvent = {
8196
8335
  id: string;
8197
- state: "pending" | "delivering" | "retrying" | "delivered" | "failed";
8336
+ state: "pending" | "delivering" | "retrying" | "delivered" | "failed" | "cancelled";
8198
8337
  attempts: number;
8199
8338
  createdAt: string;
8200
8339
  nextAttemptAt?: string;
@@ -8784,11 +8923,20 @@ declare class DefaultService$2 {
8784
8923
  };
8785
8924
  }): CancelablePromise<DeploymentPackage>;
8786
8925
  /**
8787
- * @returns Deployment Success
8926
+ * List a function's deployments from newest to oldest
8927
+ * @returns Deployment Deployments ordered by creation time and ID, both descending
8788
8928
  * @throws ApiError
8789
8929
  */
8790
- listDeployments({ id, }: {
8930
+ listDeployments({ id, limit, after, }: {
8791
8931
  id: string;
8932
+ /**
8933
+ * Maximum number of deployments to return.
8934
+ */
8935
+ limit?: number;
8936
+ /**
8937
+ * ID of the last deployment shown from the previous page of this function. Starts after that deployment.
8938
+ */
8939
+ after?: string;
8792
8940
  }): CancelablePromise<Array<Deployment>>;
8793
8941
  /**
8794
8942
  * Deploy a package to the target cloud function
@@ -8999,7 +9147,7 @@ export type SSOIdentityTokens = SSOTokens & {
8999
9147
  mode: "identity";
9000
9148
  identityToken: string;
9001
9149
  };
9002
- export interface SSOOptions extends Pick<ClientOptions, "apiUrl" | "credentials" | "credentialsFile"> {
9150
+ export interface SSOOptions extends Pick<ClientOptions, "apiUrl" | "credentials" | "credentialsFile" | "headers"> {
9003
9151
  appId: string;
9004
9152
  redirectUri: string;
9005
9153
  /** 32 random bytes encoded as base64url. Keep secret and stable across instances. */
package/index.js CHANGED
@@ -826,7 +826,7 @@ var DefaultService = class {
826
826
  }
827
827
  /**
828
828
  * Authorize using a human account login
829
- * Uses an account access token, never an application or organization token. The selected org must contain the account; org-user mode additionally requires the application's org. Produces a single-use authorization code, not API credentials.
829
+ * Requires a human account access token and an active membership in the selected organization. When the request specifies requiredOrgId, the selected organization must match. Returns a one-time authorization code.
830
830
  * @returns SSOAuthorization Verified callback URL containing code and state
831
831
  * @throws ApiError
832
832
  */
@@ -844,6 +844,26 @@ var DefaultService = class {
844
844
  mediaType: "application/json"
845
845
  });
846
846
  }
847
+ /**
848
+ * Sign in to the installed application opened in the desktop Dock
849
+ * Uses the console's account access token. The member must be able to open the installation in the selected organization, and that organization must satisfy the request's requiredOrgId when present. Only an identity request from that installation's deployed application is eligible.
850
+ * @returns SSOAuthorization Registered callback URL with a one-time authorization code and state
851
+ * @throws ApiError
852
+ */
853
+ authorizeDockSsoRequest({
854
+ requestId,
855
+ requestBody
856
+ }) {
857
+ return this.httpRequest.request({
858
+ method: "POST",
859
+ url: "/account/sso/requests/{requestId}/authorize-dock",
860
+ path: {
861
+ "requestId": requestId
862
+ },
863
+ body: requestBody,
864
+ mediaType: "application/json"
865
+ });
866
+ }
847
867
  /**
848
868
  * Remove an agent contact list member
849
869
  * Remove a delegation target from the specified agent within the current org
@@ -2863,6 +2883,25 @@ var DefaultService = class {
2863
2883
  url: "/billing/cloud-drive/capacity-summary"
2864
2884
  });
2865
2885
  }
2886
+ /**
2887
+ * List cloud drive storage and access costs by UTC usage date for the current organization
2888
+ * @returns CloudDriveDailyCost Costs for billable dates in ascending order, priced from metered usage.
2889
+ * @throws ApiError
2890
+ */
2891
+ listBillingCloudDriveDailyCosts({
2892
+ days = 30
2893
+ }) {
2894
+ return this.httpRequest.request({
2895
+ method: "GET",
2896
+ url: "/billing/cloud-drive/daily-costs",
2897
+ query: {
2898
+ "days": days
2899
+ },
2900
+ errors: {
2901
+ 400: `Invalid number of days`
2902
+ }
2903
+ });
2904
+ }
2866
2905
  /**
2867
2906
  * Read the current organization's cloud drive invoice for one UTC issue date
2868
2907
  * @returns CloudDriveInvoiceItem Incremental charges and quantities on this invoice, including late adjustments
@@ -2879,6 +2918,50 @@ var DefaultService = class {
2879
2918
  }
2880
2919
  });
2881
2920
  }
2921
+ /**
2922
+ * Get hourly storage metering for the authenticated organization on a UTC usage day
2923
+ * @returns CloudDriveStorageCoverage Completed hour intervals since activation and organization creation, including missing samples
2924
+ * @throws ApiError
2925
+ */
2926
+ getBillingCloudDriveStorageCoverage({
2927
+ usageDay
2928
+ }) {
2929
+ return this.httpRequest.request({
2930
+ method: "GET",
2931
+ url: "/billing/cloud-drive/storage-coverage/{usageDay}",
2932
+ path: {
2933
+ "usageDay": usageDay
2934
+ },
2935
+ errors: {
2936
+ 400: `Invalid UTC usage date`
2937
+ }
2938
+ });
2939
+ }
2940
+ /**
2941
+ * List cloud drive usage for a UTC day in descending access fee order
2942
+ * @returns CloudDriveUsagePage A page sorted by descending access fee and ascending drive root ID for equal fees
2943
+ * @throws ApiError
2944
+ */
2945
+ listBillingCloudDriveUsage({
2946
+ cursor,
2947
+ limit = 50,
2948
+ usageDay,
2949
+ driveKind
2950
+ }) {
2951
+ return this.httpRequest.request({
2952
+ method: "GET",
2953
+ url: "/billing/cloud-drive/usage",
2954
+ query: {
2955
+ "cursor": cursor,
2956
+ "limit": limit,
2957
+ "usageDay": usageDay,
2958
+ "driveKind": driveKind
2959
+ },
2960
+ errors: {
2961
+ 400: `Invalid usage day, drive kind or cursor`
2962
+ }
2963
+ });
2964
+ }
2882
2965
  /**
2883
2966
  * Get billing credits
2884
2967
  * Get the current organization's credit balances, lifetime spending, and invoiced and available invoice amounts.
@@ -7258,11 +7341,15 @@ var DefaultService = class {
7258
7341
  * @throws ApiError
7259
7342
  */
7260
7343
  createSsoRequest({
7261
- requestBody
7344
+ requestBody,
7345
+ xBrazosdSsoOrgId
7262
7346
  }) {
7263
7347
  return this.httpRequest.request({
7264
7348
  method: "POST",
7265
7349
  url: "/sso/requests",
7350
+ headers: {
7351
+ "X-Brazosd-SSO-Org-Id": xBrazosdSsoOrgId
7352
+ },
7266
7353
  body: requestBody,
7267
7354
  mediaType: "application/json"
7268
7355
  });
@@ -9042,11 +9129,14 @@ var DefaultService3 = class {
9042
9129
  });
9043
9130
  }
9044
9131
  /**
9045
- * @returns Deployment Success
9132
+ * List a function's deployments from newest to oldest
9133
+ * @returns Deployment Deployments ordered by creation time and ID, both descending
9046
9134
  * @throws ApiError
9047
9135
  */
9048
9136
  listDeployments({
9049
- id
9137
+ id,
9138
+ limit = 100,
9139
+ after
9050
9140
  }) {
9051
9141
  return this.httpRequest.request({
9052
9142
  method: "GET",
@@ -9054,6 +9144,10 @@ var DefaultService3 = class {
9054
9144
  path: {
9055
9145
  "id": id
9056
9146
  },
9147
+ query: {
9148
+ "limit": limit,
9149
+ "after": after
9150
+ },
9057
9151
  errors: {
9058
9152
  400: `Invalid input`,
9059
9153
  401: `Unauthorized`,
@@ -9389,6 +9483,13 @@ var operations = {
9389
9483
  "200": "json"
9390
9484
  }
9391
9485
  },
9486
+ "POST /account/sso/requests/{requestId}/authorize-dock": {
9487
+ "authenticated": true,
9488
+ "redirect": false,
9489
+ "responses": {
9490
+ "200": "json"
9491
+ }
9492
+ },
9392
9493
  "DELETE /agent-contact-list/{agentId}": {
9393
9494
  "authenticated": true,
9394
9495
  "redirect": false,
@@ -10223,6 +10324,14 @@ var operations = {
10223
10324
  "200": "json"
10224
10325
  }
10225
10326
  },
10327
+ "GET /billing/cloud-drive/daily-costs": {
10328
+ "authenticated": true,
10329
+ "redirect": false,
10330
+ "responses": {
10331
+ "200": "json",
10332
+ "400": "void"
10333
+ }
10334
+ },
10226
10335
  "GET /billing/cloud-drive/invoices/{invoiceDay}": {
10227
10336
  "authenticated": true,
10228
10337
  "redirect": false,
@@ -10230,6 +10339,22 @@ var operations = {
10230
10339
  "200": "json"
10231
10340
  }
10232
10341
  },
10342
+ "GET /billing/cloud-drive/storage-coverage/{usageDay}": {
10343
+ "authenticated": true,
10344
+ "redirect": false,
10345
+ "responses": {
10346
+ "200": "json",
10347
+ "400": "void"
10348
+ }
10349
+ },
10350
+ "GET /billing/cloud-drive/usage": {
10351
+ "authenticated": true,
10352
+ "redirect": false,
10353
+ "responses": {
10354
+ "200": "json",
10355
+ "400": "void"
10356
+ }
10357
+ },
10233
10358
  "GET /billing/credits": {
10234
10359
  "authenticated": true,
10235
10360
  "redirect": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brazosd/node",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Brazosd Node.js SDK with automatic cloud function identity",
5
5
  "repository": {
6
6
  "type": "git",