@samebase/alchemy-convex 0.14.1 → 0.16.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/lib/index.d.ts CHANGED
@@ -407,6 +407,45 @@ export declare class ProjectNotFound extends ProjectNotFound_base {
407
407
  get message(): string;
408
408
  }
409
409
  //#endregion
410
+ //#region src/HubClient.d.ts
411
+ /** The name of the project of the hub in each team. */
412
+ export declare const HUB_PROJECT_NAME = "samebase";
413
+ type HubDeploymentType = "production" | "development" | "preview";
414
+ interface HubClientProps {
415
+ /** The Convex team, a slug or an id, whose project `samebase` holds the hub. */
416
+ readonly team: string | number;
417
+ /** The app on the hub, such as `scout`. The first client of an app creates it, as a first-party app. */
418
+ readonly app: string;
419
+ /** The deployment's callback URL, such as `<deployment site URL>/auth/hub/callback`. */
420
+ readonly redirectUri: string;
421
+ readonly deploymentType: HubDeploymentType;
422
+ /** The name the hub records for the client. */
423
+ readonly clientName: string;
424
+ /** Recorded on the hub's client, such as the commit. The hub records "unknown" without it. */
425
+ readonly softwareVersion?: string;
426
+ }
427
+ interface HubClientAttributes {
428
+ /** The issuer of the hub, which the deployment names to sign in. */
429
+ readonly issuer: string;
430
+ readonly redirectUri: string;
431
+ readonly deploymentType: HubDeploymentType;
432
+ /** The name the client was registered with. */
433
+ readonly clientName: string;
434
+ readonly clientId: string;
435
+ /** Returned by the hub only at registration. */
436
+ readonly clientSecret: Redacted.Redacted<string>;
437
+ }
438
+ export type HubClient = Resource<"IdentityHub.Client", HubClientProps, HubClientAttributes, never, Providers>;
439
+ export declare const HubClient: import("alchemy").ResourceClass<HubClient>;
440
+ declare const HubClientFailed_base: Schema.Class<HubClientFailed, Schema.TaggedStruct<"HubClientFailed", {
441
+ readonly team: Schema.Union<readonly [Schema.String, Schema.Number]>;
442
+ readonly reason: Schema.String;
443
+ }>, import("effect/Cause").YieldableError>;
444
+ /** The hub of the team could not do the call. The reason is the Convex message: it holds no secret. */
445
+ export declare class HubClientFailed extends HubClientFailed_base {
446
+ get message(): string;
447
+ }
448
+ //#endregion
410
449
  //#region src/RunRecord.d.ts
411
450
  /** The key of the record in the stage output document. */
412
451
  export declare const RUN_RECORD_KEY = "samebase.run";
@@ -457,32 +496,18 @@ export declare const withRunRecord: (output: unknown, record: RunRecord) => obje
457
496
  //#endregion
458
497
  //#region src/State.d.ts
459
498
  /** The name of the state project in each team. */
460
- export declare const STORE_PROJECT_NAME = "samebase";
461
- declare const OutdatedBase_base: Schema.Class<OutdatedBase, Schema.TaggedStruct<"OutdatedBase", {
462
- readonly team: Schema.Union<readonly [Schema.String, Schema.Number]>;
463
- readonly deployment: Schema.String;
464
- readonly version: Schema.Number;
465
- }>, import("effect/Cause").YieldableError>;
466
- /**
467
- * The base app of the team serves an older store. Convex.state() never
468
- * pushes its store app over a base, because the push replaces every function
469
- * of the deployment and so erases the base app.
470
- */
471
- export declare class OutdatedBase extends OutdatedBase_base {
472
- get message(): string;
473
- }
499
+ export declare const STORE_PROJECT_NAME = "alchemy-state-store";
474
500
  /**
475
- * Alchemy state in the `samebase` project of `team`, with the team token
501
+ * Alchemy state in the `alchemy-state-store` project of `team`, with the team token
476
502
  * in CONVEX_ACCESS_TOKEN or the Convex CLI login. A team access token names
477
503
  * its team, so `team` is optional with one; the Convex CLI login needs the
478
504
  * slug or the id. The first use of the run finds or creates the project and
479
- * pushes the store app when the store is missing or an older seed. An older
480
- * base fails the run with {@link OutdatedBase}. `alchemy plan` on another
505
+ * pushes the store when it is missing or older. `alchemy plan` on another
481
506
  * stack never touches Convex.
482
507
  */
483
508
  export declare const state: (options?: {
484
509
  readonly team?: string | number;
485
510
  }) => Layer.Layer<State, never, ChildProcessSpawner.ChildProcessSpawner>;
486
511
  //#endregion
487
- export type { ComponentBinding, DeploymentAttributes, DeploymentInput, DeploymentProps, DeploymentRegion, EnvValue, ProjectAttributes, ProjectProps, RunRecord, Source };
512
+ export type { ComponentBinding, DeploymentAttributes, DeploymentInput, DeploymentProps, DeploymentRegion, EnvValue, HubClientAttributes, HubClientProps, HubDeploymentType, ProjectAttributes, ProjectProps, RunRecord, Source };
488
513
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/Credentials.ts","../src/ManagementApi.ts","../src/Providers.ts","../src/Push.ts","../src/Deployment.ts","../src/Component.ts","../src/Project.ts","../src/RunRecord.ts","../src/State.ts"],"mappings":";;;;;;;;;;;;;;;;UA6BiB;;WAEN,aAAa,SAAS;;WAEtB;;UAGM;;WAEN,aAAa,OAAO,OAAO;;WAE3B,gBAAgB,OAAO;;WAEvB,WAAW,OAAO,OAAO,SAAS;;;qBAGhC,oBAAoB;;qBAKpB;;qBAGA;;;;qBAOA,yBAAyB;;;;;;;;;qBAiCzB,kBAAiB,MAAM,MAAM;;qBA0B7B,aAAc;WAChB,cAAc,SAAS;WACvB,YAAY,SAAS;MAC5B,MAAM,MAAM;;;KC3GJ,mBAAmB,kBAAkB;KACrC,mBAAmB,kBAAkB;;UAGhC,YAAY;WAClB,OAAO;WACP;WACA,UAAU;;;;;;;;;;;;;qBAQR,uBAAuB;UAuBnB;;WAEN,UAAU,GACjB,mBACA,MAAM,QAAQ,qBAAqB,QAAQ,YAAY,QACpD,OAAO,OAAO,GAAG;;WAEb,cACP,mBACA,MAAM,QAAQ,qBAAqB,QAAQ,0BACxC,OAAO,aAAa;;WAEhB,oBAAoB,GAC3B,mBACA,6BACA,WAAW,SAAS,kBACpB,MAAM,QAAQ,qBAAqB,QAAQ,YAAY,QACpD,OAAO,OAAO,GAAG;;;;;;;;WAQb,gBACP,sCACG,OAAO,eAAe;;;;;;;;WAQlB,oBAAoB,mBAAmB,OAAO;;;;;WAK9C,YAAY,OAAO,SAAS,qBAAqB;;;qBAM/C,sBAAsB;;;;qBC1FtB,kBAAkB;;;;;;qBAOlB,YAAa,cAAa,MAAM,MAAM,iBAA2B,MAAA,MAAA,8CAAA,mCAAA,oDAAA;;;;KC+BlE,oB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AMF,wBAAwB;MAItB;;;;;qBC5GF;;UAMI;WACN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;;WAEA;;;;;qBAGE,uBAAuB;MAGrB;;;UAME;WACN;WACA,KAAK,SAAS;;;;;;;;qBAuIZ,YAAa,OAAO,mBAAiB,OAAO,OAAO,WAAW;;;;;;;qBAgB9D,gBAAiB,iBAAiB,QAAQ;;;;qBCrH1C;;;;;;;;;;;qBAwLA,qBAAqB;MAKnB;;;;;;;;;;;qBAqOF,QACX;WAAoB;MACnB,MAAM,MAAM,cAAc,oBAAoB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/Credentials.ts","../src/ManagementApi.ts","../src/Providers.ts","../src/Push.ts","../src/Deployment.ts","../src/Component.ts","../src/Project.ts","../src/HubClient.ts","../src/RunRecord.ts","../src/State.ts"],"mappings":";;;;;;;;;;;;;;;;UA6BiB;;WAEN,aAAa,SAAS;;WAEtB;;UAGM;;WAEN,aAAa,OAAO,OAAO;;WAE3B,gBAAgB,OAAO;;WAEvB,WAAW,OAAO,OAAO,SAAS;;;qBAGhC,oBAAoB;;qBAKpB;;qBAGA;;;;qBAOA,yBAAyB;;;;;;;;;qBAiCzB,kBAAiB,MAAM,MAAM;;qBA0B7B,aAAc;WAChB,cAAc,SAAS;WACvB,YAAY,SAAS;MAC5B,MAAM,MAAM;;;KC3GJ,mBAAmB,kBAAkB;KACrC,mBAAmB,kBAAkB;;UAGhC,YAAY;WAClB,OAAO;WACP;WACA,UAAU;;;;;;;;;;;;;qBAQR,uBAAuB;UAuBnB;;WAEN,UAAU,GACjB,mBACA,MAAM,QAAQ,qBAAqB,QAAQ,YAAY,QACpD,OAAO,OAAO,GAAG;;WAEb,cACP,mBACA,MAAM,QAAQ,qBAAqB,QAAQ,0BACxC,OAAO,aAAa;;WAEhB,oBAAoB,GAC3B,mBACA,6BACA,WAAW,SAAS,kBACpB,MAAM,QAAQ,qBAAqB,QAAQ,YAAY,QACpD,OAAO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