@zinn-digital/sdk 0.1.1569 → 0.1.1571

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.
@@ -13951,6 +13951,33 @@ export interface paths {
13951
13951
  patch?: never;
13952
13952
  trace?: never;
13953
13953
  };
13954
+ "/v1/admin/sites/{siteId}/application-reinstall": {
13955
+ parameters: {
13956
+ query?: never;
13957
+ header?: never;
13958
+ path: {
13959
+ /** @description Site ID (UUIDv7). */
13960
+ siteId: components["parameters"]["SiteId"];
13961
+ };
13962
+ cookie?: never;
13963
+ };
13964
+ /**
13965
+ * Staff view of a site's application reinstall surface, with backup paths.
13966
+ * @description **Staff only** (`sites.restart`). The customer's `getSiteApplicationReinstall` plus the backup paths on the server and the failing step's message.
13967
+ */
13968
+ get: operations["adminGetSiteApplicationReinstall"];
13969
+ put?: never;
13970
+ /**
13971
+ * Staff reinstall of a site's PHP application, after backing it up.
13972
+ * @description **Staff only** (`sites.restart`), audit-logged with the stated `reason` on a staff-only row. Exactly the customer's `startSiteApplicationReinstall` otherwise: the same typed domain, the same backups, the same workflow.
13973
+ */
13974
+ post: operations["adminStartSiteApplicationReinstall"];
13975
+ delete?: never;
13976
+ options?: never;
13977
+ head?: never;
13978
+ patch?: never;
13979
+ trace?: never;
13980
+ };
13954
13981
  "/v1/admin/sites/{siteId}/cdn/rotate": {
13955
13982
  parameters: {
13956
13983
  query?: never;
@@ -38382,7 +38409,7 @@ export interface paths {
38382
38409
  put?: never;
38383
38410
  /**
38384
38411
  * Switch an AI Move over now (the GO).
38385
- * @description The same consent as replying GO on the move's ticket. Refused with 409 unless the copy has passed its preview and app checks (`stage` is `awaiting_cutover`); the live check follows the switch-over and the move is `done` only when the customer's own domain reaches our server. Requires `hosting.import.manage`.
38412
+ * @description The same consent as replying GO on the move's ticket. Refused with 409 unless the copy has passed its preview and app checks (`stage` is `awaiting_cutover`), and refused with 409 once the customer put the replaced site back (the copy was restored over); the live check follows the switch-over and the move is `done` only when the customer's own domain reaches our server. Requires `hosting.import.manage`.
38386
38413
  */
38387
38414
  post: operations["goAiMove"];
38388
38415
  delete?: never;
@@ -48646,6 +48673,37 @@ export interface paths {
48646
48673
  patch?: never;
48647
48674
  trace?: never;
48648
48675
  };
48676
+ "/v1/sites/{siteId}/application-reinstall": {
48677
+ parameters: {
48678
+ query?: never;
48679
+ header?: never;
48680
+ path: {
48681
+ /** @description Site ID (UUIDv7). */
48682
+ siteId: components["parameters"]["SiteId"];
48683
+ };
48684
+ cookie?: never;
48685
+ };
48686
+ /**
48687
+ * Whether this site's PHP application can be reinstalled, and the latest run.
48688
+ * @description MOODLEOPS-r26 (docs/557 §11). The card's one read: which modes are offered (`keep_database` only where the application can reconnect new files to its existing tables) and the latest reinstall with its outcome. Requires `sites.view`. `503` when the workflow engine cannot be asked — "could not ask" never reads as "never ran".
48689
+ */
48690
+ get: operations["getSiteApplicationReinstall"];
48691
+ put?: never;
48692
+ /**
48693
+ * Reinstall an active site's PHP application, after backing it up.
48694
+ * @description Rebuilds an `active` PHP application site (any application, not only Moodle) — the door for a site whose files are gone, which `retrySiteProvisioning` (failed or pending sites only) cannot reach. The site's domain must be typed in `confirm_domain`.
48695
+ *
48696
+ * **The database and the files are ALWAYS backed up first** into a root-only store on the server, read back (every table in the dump, the archive passes `gzip -t`), and only then cleared. `keep_database` lays down fresh files and reconnects them to the existing tables; `fresh` also clears the application's data directory and tables and installs from nothing. The request is queued through the transactional outbox and a consumer starts the Temporal workflow (one per site, so a press while one is running is absorbed by it): a workflow-engine outage delays a reinstall and never fails this request. The moment it is queued this answers `202`; follow it on the `GET`. With `keep_database` Moodle's own non-interactive upgrade then brings the kept database up to the new release. Audit-logged (`site.application.reinstall_requested`, then `site.application.reinstalled` or `site.application.reinstall_failed`). Requires `sites.view` and `hosting.deploy.manage`.
48697
+ *
48698
+ * `422` with a refusal key: `refusal.sites.reinstallConfirmMismatch`, `reinstallNotActive`, `reinstallNotPhpApp`, `reinstallNoApplication`, `reinstallNotOnFleet`, `reinstallKeepDatabaseUnsupported`, `reinstallBadMode`.
48699
+ */
48700
+ post: operations["startSiteApplicationReinstall"];
48701
+ delete?: never;
48702
+ options?: never;
48703
+ head?: never;
48704
+ patch?: never;
48705
+ trace?: never;
48706
+ };
48649
48707
  "/v1/sites/{siteId}/backups": {
48650
48708
  parameters: {
48651
48709
  query?: never;
@@ -101593,6 +101651,64 @@ export interface components {
101593
101651
  /** @description 0 = Monday to 6 = Sunday; null = every day. */
101594
101652
  window_weekday: number | null;
101595
101653
  };
101654
+ SiteApplicationReinstall: {
101655
+ application: {
101656
+ key: string;
101657
+ name: string;
101658
+ } | null;
101659
+ available: boolean;
101660
+ modes: {
101661
+ available: boolean;
101662
+ mode: components["schemas"]["SiteApplicationReinstallMode"];
101663
+ /** @enum {string|null} */
101664
+ reason: "keep_database_unsupported" | null;
101665
+ }[];
101666
+ primary_domain: string;
101667
+ /**
101668
+ * @description Why the site cannot be reinstalled; `null` when it can.
101669
+ * @enum {string|null}
101670
+ */
101671
+ refusal: "not_php_app" | "no_application" | "not_on_fleet" | "not_active" | null;
101672
+ /** @description The latest reinstall of this site; `null` when there has never been one. */
101673
+ run: {
101674
+ /** Format: date-time */
101675
+ closed_at: string | null;
101676
+ database_backed_up: boolean;
101677
+ /** @description Staff only — the database dump's path on the server. */
101678
+ database_backup?: string | null;
101679
+ /** @description Staff only — the failing step's message. */
101680
+ error?: string | null;
101681
+ files_backed_up: boolean;
101682
+ /** @description Staff only — the files archive's path on the server. */
101683
+ files_backup?: string | null;
101684
+ mode: components["schemas"]["SiteApplicationReinstallMode"] | null;
101685
+ /** @enum {string|null} */
101686
+ outcome: "reinstalled" | "failed" | null;
101687
+ /** Format: date-time */
101688
+ started_at: string | null;
101689
+ /** @description Temporal's status — RUNNING, COMPLETED, FAILED, TERMINATED, TIMED_OUT, ... */
101690
+ status: string;
101691
+ workflow_id: string;
101692
+ } | null;
101693
+ /** Format: uuid */
101694
+ site_id: string;
101695
+ };
101696
+ /**
101697
+ * @description `keep_database` — fresh files reconnected to the existing tables; `fresh` — files, data directory and tables cleared and the application installed from nothing. Both back the database and files up first.
101698
+ * @enum {string}
101699
+ */
101700
+ SiteApplicationReinstallMode: "keep_database" | "fresh";
101701
+ SiteApplicationReinstallRequest: {
101702
+ /** @description The site's primary domain, typed by the customer (case-insensitive). */
101703
+ confirm_domain: string;
101704
+ mode: components["schemas"]["SiteApplicationReinstallMode"];
101705
+ };
101706
+ SiteApplicationReinstallStart: {
101707
+ mode: components["schemas"]["SiteApplicationReinstallMode"];
101708
+ /** @description `true` once the request is queued. A consumer starts the workflow; a run already going absorbs the request (one workflow id per site). */
101709
+ started: boolean;
101710
+ workflow_id: string;
101711
+ };
101596
101712
  SiteBackup: {
101597
101713
  /** Format: date-time */
101598
101714
  created_at: string;
@@ -108876,6 +108992,7 @@ export interface components {
108876
108992
  /** @description Why staff are doing this. Stored in the audit row, never shown to the customer — it is read months later by someone asking why a site was rebuilt or removed. */
108877
108993
  reason: string;
108878
108994
  };
108995
+ StaffSiteApplicationReinstallRequest: components["schemas"]["StaffRecoveryReason"] & components["schemas"]["SiteApplicationReinstallRequest"];
108879
108996
  StaffSiteDeletion: {
108880
108997
  deletion: components["schemas"]["SiteDeletion"];
108881
108998
  /**
@@ -137218,6 +137335,64 @@ export interface operations {
137218
137335
  429: components["responses"]["TooManyRequests"];
137219
137336
  };
137220
137337
  };
137338
+ adminGetSiteApplicationReinstall: {
137339
+ parameters: {
137340
+ query?: never;
137341
+ header?: never;
137342
+ path: {
137343
+ /** @description Site ID (UUIDv7). */
137344
+ siteId: components["parameters"]["SiteId"];
137345
+ };
137346
+ cookie?: never;
137347
+ };
137348
+ requestBody?: never;
137349
+ responses: {
137350
+ /** @description The reinstall surface for this site. */
137351
+ 200: {
137352
+ headers: {
137353
+ [name: string]: unknown;
137354
+ };
137355
+ content: {
137356
+ "application/json": components["schemas"]["SiteApplicationReinstall"];
137357
+ };
137358
+ };
137359
+ 401: components["responses"]["Unauthorized"];
137360
+ 403: components["responses"]["Forbidden"];
137361
+ 404: components["responses"]["NotFound"];
137362
+ 503: components["responses"]["ServiceUnavailable"];
137363
+ };
137364
+ };
137365
+ adminStartSiteApplicationReinstall: {
137366
+ parameters: {
137367
+ query?: never;
137368
+ header?: never;
137369
+ path: {
137370
+ /** @description Site ID (UUIDv7). */
137371
+ siteId: components["parameters"]["SiteId"];
137372
+ };
137373
+ cookie?: never;
137374
+ };
137375
+ requestBody: {
137376
+ content: {
137377
+ "application/json": components["schemas"]["StaffSiteApplicationReinstallRequest"];
137378
+ };
137379
+ };
137380
+ responses: {
137381
+ /** @description The reinstall request is durably queued (the outbox), as for the customer. */
137382
+ 202: {
137383
+ headers: {
137384
+ [name: string]: unknown;
137385
+ };
137386
+ content: {
137387
+ "application/json": components["schemas"]["SiteApplicationReinstallStart"];
137388
+ };
137389
+ };
137390
+ 401: components["responses"]["Unauthorized"];
137391
+ 403: components["responses"]["Forbidden"];
137392
+ 404: components["responses"]["NotFound"];
137393
+ 422: components["responses"]["UnprocessableEntity"];
137394
+ };
137395
+ };
137221
137396
  rotateSiteCdn: {
137222
137397
  parameters: {
137223
137398
  query?: never;
@@ -195383,6 +195558,66 @@ export interface operations {
195383
195558
  503: components["responses"]["ServiceUnavailable"];
195384
195559
  };
195385
195560
  };
195561
+ getSiteApplicationReinstall: {
195562
+ parameters: {
195563
+ query?: never;
195564
+ header?: never;
195565
+ path: {
195566
+ /** @description Site ID (UUIDv7). */
195567
+ siteId: components["parameters"]["SiteId"];
195568
+ };
195569
+ cookie?: never;
195570
+ };
195571
+ requestBody?: never;
195572
+ responses: {
195573
+ /** @description The reinstall surface for this site. */
195574
+ 200: {
195575
+ headers: {
195576
+ [name: string]: unknown;
195577
+ };
195578
+ content: {
195579
+ "application/json": components["schemas"]["SiteApplicationReinstall"];
195580
+ };
195581
+ };
195582
+ 401: components["responses"]["Unauthorized"];
195583
+ 403: components["responses"]["Forbidden"];
195584
+ 404: components["responses"]["NotFound"];
195585
+ 429: components["responses"]["TooManyRequests"];
195586
+ 503: components["responses"]["ServiceUnavailable"];
195587
+ };
195588
+ };
195589
+ startSiteApplicationReinstall: {
195590
+ parameters: {
195591
+ query?: never;
195592
+ header?: never;
195593
+ path: {
195594
+ /** @description Site ID (UUIDv7). */
195595
+ siteId: components["parameters"]["SiteId"];
195596
+ };
195597
+ cookie?: never;
195598
+ };
195599
+ requestBody: {
195600
+ content: {
195601
+ "application/json": components["schemas"]["SiteApplicationReinstallRequest"];
195602
+ };
195603
+ };
195604
+ responses: {
195605
+ /** @description The reinstall request is durably queued. */
195606
+ 202: {
195607
+ headers: {
195608
+ [name: string]: unknown;
195609
+ };
195610
+ content: {
195611
+ "application/json": components["schemas"]["SiteApplicationReinstallStart"];
195612
+ };
195613
+ };
195614
+ 401: components["responses"]["Unauthorized"];
195615
+ 403: components["responses"]["Forbidden"];
195616
+ 404: components["responses"]["NotFound"];
195617
+ 422: components["responses"]["UnprocessableEntity"];
195618
+ 429: components["responses"]["TooManyRequests"];
195619
+ };
195620
+ };
195386
195621
  getSiteBackups: {
195387
195622
  parameters: {
195388
195623
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1569",
3
+ "version": "0.1.1571",
4
4
  "description": "Typed TypeScript client for the Zinn Digital Platform API, generated from its OpenAPI spec.",
5
5
  "license": "MIT",
6
6
  "author": "Neil Lock \u2014 CEO, Zinn Digital\u00ae Ltd <office@zinndigital.com>",