polytomic 25.9.5 → 25.9.7

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.
Files changed (71) hide show
  1. package/BaseClient.js +2 -2
  2. package/api/resources/bulkSync/client/Client.d.ts +4 -2
  3. package/api/resources/bulkSync/client/Client.js +4 -2
  4. package/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +1 -1
  5. package/api/resources/bulkSync/resources/schemas/client/Client.d.ts +1 -0
  6. package/api/resources/bulkSync/resources/schemas/client/Client.js +3 -0
  7. package/api/resources/harbors/client/Client.d.ts +424 -0
  8. package/api/resources/harbors/client/Client.js +946 -0
  9. package/api/resources/harbors/client/requests/CreateHarborSavedQueryDraftRequest.d.ts +24 -0
  10. package/api/resources/harbors/client/requests/CreateHarborSavedQueryDraftRequest.js +3 -0
  11. package/api/resources/harbors/client/requests/ExecuteHarborSavedQueryRequest.d.ts +10 -0
  12. package/api/resources/harbors/client/requests/ExecuteHarborSavedQueryRequest.js +3 -0
  13. package/api/resources/harbors/client/requests/HarborsGetSavedQueryRequest.d.ts +8 -0
  14. package/api/resources/harbors/client/requests/HarborsGetSavedQueryRequest.js +3 -0
  15. package/api/resources/harbors/client/requests/HarborsListSavedQueriesRequest.d.ts +15 -0
  16. package/api/resources/harbors/client/requests/HarborsListSavedQueriesRequest.js +3 -0
  17. package/api/resources/harbors/client/requests/HarborsListSavedQueryDraftsRequest.d.ts +13 -0
  18. package/api/resources/harbors/client/requests/HarborsListSavedQueryDraftsRequest.js +3 -0
  19. package/api/resources/harbors/client/requests/SaveHarborSavedQueryDraftRequest.d.ts +24 -0
  20. package/api/resources/harbors/client/requests/SaveHarborSavedQueryDraftRequest.js +3 -0
  21. package/api/resources/harbors/client/requests/index.d.ts +6 -0
  22. package/api/resources/modelSync/client/requests/CreateModelSyncV5Request.d.ts +3 -0
  23. package/api/resources/modelSync/client/requests/UpdateModelSyncV5Request.d.ts +3 -0
  24. package/api/types/DeletedHarborSavedQueryDraftEnvelope.d.ts +9 -0
  25. package/api/types/DeletedHarborSavedQueryDraftEnvelope.js +3 -0
  26. package/api/types/DeletedHarborSavedQueryEnvelope.d.ts +9 -0
  27. package/api/types/DeletedHarborSavedQueryEnvelope.js +3 -0
  28. package/api/types/ExecuteHarborSavedQueryEnvelope.d.ts +27 -0
  29. package/api/types/ExecuteHarborSavedQueryEnvelope.js +3 -0
  30. package/api/types/HarborResponse.d.ts +2 -0
  31. package/api/types/HarborSavedQueryDraftEnvelope.d.ts +4 -0
  32. package/api/types/HarborSavedQueryDraftEnvelope.js +3 -0
  33. package/api/types/HarborSavedQueryDraftListEnvelope.d.ts +5 -0
  34. package/api/types/HarborSavedQueryDraftListEnvelope.js +3 -0
  35. package/api/types/HarborSavedQueryDraftResponse.d.ts +33 -0
  36. package/api/types/HarborSavedQueryDraftResponse.js +3 -0
  37. package/api/types/HarborSavedQueryEnvelope.d.ts +4 -0
  38. package/api/types/HarborSavedQueryEnvelope.js +3 -0
  39. package/api/types/HarborSavedQueryListEnvelope.d.ts +5 -0
  40. package/api/types/HarborSavedQueryListEnvelope.js +3 -0
  41. package/api/types/HarborSavedQueryMetadataResponse.d.ts +20 -0
  42. package/api/types/HarborSavedQueryMetadataResponse.js +3 -0
  43. package/api/types/HarborSavedQueryParameter.d.ts +22 -0
  44. package/api/types/HarborSavedQueryParameter.js +16 -0
  45. package/api/types/HarborSavedQueryPreviewResponse.d.ts +8 -0
  46. package/api/types/HarborSavedQueryPreviewResponse.js +3 -0
  47. package/api/types/HarborSavedQueryResponse.d.ts +31 -0
  48. package/api/types/HarborSavedQueryResponse.js +3 -0
  49. package/api/types/HarborSavedQueryValidationEnvelope.d.ts +4 -0
  50. package/api/types/HarborSavedQueryValidationEnvelope.js +3 -0
  51. package/api/types/HarboractivityapiHarborActivityEvent.d.ts +1 -0
  52. package/api/types/HarboractivityapiHarborActivityMetadata.d.ts +3 -0
  53. package/api/types/HarboractivityapiHarborActivityQuerySource.d.ts +7 -0
  54. package/api/types/HarboractivityapiHarborActivityQuerySource.js +3 -0
  55. package/api/types/HarboractivityapiHarborActivitySavedQuerySource.d.ts +7 -0
  56. package/api/types/HarboractivityapiHarborActivitySavedQuerySource.js +3 -0
  57. package/api/types/HarboractivityapiHarborActivityTarget.d.ts +2 -0
  58. package/api/types/ModelSyncIdentities.d.ts +18 -0
  59. package/api/types/ModelSyncIdentities.js +12 -0
  60. package/api/types/ModelSyncProblem.d.ts +10 -0
  61. package/api/types/ModelSyncProblem.js +3 -0
  62. package/api/types/ModelSyncV5Response.d.ts +5 -0
  63. package/api/types/SyncDestinationProperties.d.ts +2 -0
  64. package/api/types/TypesDefinition.d.ts +4 -1
  65. package/api/types/UserFieldRequest.d.ts +3 -1
  66. package/api/types/index.d.ts +17 -0
  67. package/api/types/index.js +17 -0
  68. package/package.json +1 -1
  69. package/reference.md +956 -2
  70. package/version.d.ts +1 -1
  71. package/version.js +1 -1
package/reference.md CHANGED
@@ -308,11 +308,13 @@ naming options behave the same as on create when left out:
308
308
  - `normalize_names` resets to enabled.
309
309
 
310
310
  Send the existing values explicitly if you want to preserve a non-default or
311
- non-empty setting, including schema and field selections.
311
+ non-empty setting.
312
312
 
313
313
  > 📘 Updating schemas
314
314
  >
315
- > Schema updates are not performed through this endpoint. Use the
315
+ > When `schemas` is present, it replaces the sync's schema selection: schemas
316
+ > not in the list are disabled. When `schemas` is omitted or empty, the sync's
317
+ > schemas are left unchanged. Use the
316
318
  > [Update Bulk Sync Schemas](../../../../api-reference/bulk-sync/schemas/patch)
317
319
  > endpoint to change a subset of schemas, or
318
320
  > [Update Bulk Sync Schema](../../../../api-reference/bulk-sync/schemas/update)
@@ -5278,6 +5280,11 @@ Creates a managed or customer-managed Harbor in the caller's current organizatio
5278
5280
  `generate_api_key` defaults to `true`. Polytomic returns a new plaintext credential only in this response. Set it to `false` to create the Harbor without a credential.
5279
5281
 
5280
5282
  For `customer_managed`, `backing_connection_id` must identify a queryable Connection that your credential can access.
5283
+
5284
+ Managed Harbors return with `status: provisioning` while Polytomic sets up their
5285
+ storage in the background. Poll `GET /api/harbors/{harbor_id}` until the status is
5286
+ `ready` before adding sources or querying data. If provisioning fails, the status
5287
+ is `provisioning_failed` and Polytomic retries automatically.
5281
5288
  </dd>
5282
5289
  </dl>
5283
5290
  </dd>
@@ -5492,6 +5499,10 @@ Deletes a Harbor and revokes its credentials.
5492
5499
  > 🚧 Harbor deletion
5493
5500
  >
5494
5501
  > Deleting a Harbor revokes its credentials, context documents, and user assignments. A customer-managed backing Connection remains available. Polytomic deletes a managed backing Connection only when no other resource uses it.
5502
+
5503
+ The response confirms that access has been revoked. Polytomic removes managed
5504
+ storage in the background and retries failed cleanup automatically. You can also
5505
+ delete a Harbor while it is provisioning.
5495
5506
  </dd>
5496
5507
  </dl>
5497
5508
  </dd>
@@ -6860,6 +6871,949 @@ await client.harbors.deleteKey("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7
6860
6871
  </dl>
6861
6872
 
6862
6873
 
6874
+ </dd>
6875
+ </dl>
6876
+ </details>
6877
+
6878
+ <details><summary><code>client.harbors.<a href="/src/api/resources/harbors/client/Client.ts">listSavedQueries</a>(harbor_id, { ...params }) -> Polytomic.HarborSavedQueryListEnvelope</code></summary>
6879
+ <dl>
6880
+ <dd>
6881
+
6882
+ #### 📝 Description
6883
+
6884
+ <dl>
6885
+ <dd>
6886
+
6887
+ <dl>
6888
+ <dd>
6889
+
6890
+ Lists current published saved queries for a Harbor.
6891
+
6892
+ Saved queries are supported only for Polytomic-managed Harbors whose backing
6893
+ Connection type is `polytomic_harbor`.
6894
+
6895
+ Collection items contain current published metadata and omit SQL, parameter
6896
+ values, and unpublished drafts. A Harbor profile credential can list saved
6897
+ queries only when `harbor_id` identifies its own Harbor.
6898
+
6899
+ ## Harbor Activity
6900
+
6901
+ When you use a Harbor profile credential, send a new nonzero UUID in
6902
+ `X-Polytomic-Activity-Request-ID` for each request, including each page. A
6903
+ missing or invalid ID returns `400 Bad Request`. Reusing a consumed ID returns
6904
+ `409 Conflict`.
6905
+
6906
+ If you supply `X-Polytomic-Harbor-Session`, the session must be active and bound
6907
+ to your credential and Harbor. An invalid session returns `403 Forbidden`.
6908
+ Direct scoped REST requests may omit the session header.
6909
+
6910
+ Polytomic records `saved_query.listed` before returning data. The event describes
6911
+ only the returned page, including saved-query IDs, immutable revision IDs,
6912
+ version numbers, and bounded name snapshots. Activity excludes SQL, parameter
6913
+ values, and expected column names. If Polytomic cannot record the event, the
6914
+ request returns `503 Service Unavailable` without saved-query data.
6915
+ </dd>
6916
+ </dl>
6917
+ </dd>
6918
+ </dl>
6919
+
6920
+ #### 🔌 Usage
6921
+
6922
+ <dl>
6923
+ <dd>
6924
+
6925
+ <dl>
6926
+ <dd>
6927
+
6928
+ ```typescript
6929
+ await client.harbors.listSavedQueries("248df4b7-aa70-47b8-a036-33ac447e668d", {
6930
+ limit: 1,
6931
+ page_token: "page_token"
6932
+ });
6933
+
6934
+ ```
6935
+ </dd>
6936
+ </dl>
6937
+ </dd>
6938
+ </dl>
6939
+
6940
+ #### ⚙️ Parameters
6941
+
6942
+ <dl>
6943
+ <dd>
6944
+
6945
+ <dl>
6946
+ <dd>
6947
+
6948
+ **harbor_id:** `string` — Unique identifier of the Harbor.
6949
+
6950
+ </dd>
6951
+ </dl>
6952
+
6953
+ <dl>
6954
+ <dd>
6955
+
6956
+ **request:** `Polytomic.HarborsListSavedQueriesRequest`
6957
+
6958
+ </dd>
6959
+ </dl>
6960
+
6961
+ <dl>
6962
+ <dd>
6963
+
6964
+ **requestOptions:** `HarborsClient.RequestOptions`
6965
+
6966
+ </dd>
6967
+ </dl>
6968
+ </dd>
6969
+ </dl>
6970
+
6971
+
6972
+ </dd>
6973
+ </dl>
6974
+ </details>
6975
+
6976
+ <details><summary><code>client.harbors.<a href="/src/api/resources/harbors/client/Client.ts">createSavedQueryDraft</a>(harbor_id, { ...params }) -> Polytomic.HarborSavedQueryDraftEnvelope</code></summary>
6977
+ <dl>
6978
+ <dd>
6979
+
6980
+ #### 📝 Description
6981
+
6982
+ <dl>
6983
+ <dd>
6984
+
6985
+ <dl>
6986
+ <dd>
6987
+
6988
+ Creates a stable Harbor saved query with its initial mutable draft.
6989
+
6990
+ Saved queries are supported only for Polytomic-managed Harbors whose backing
6991
+ Connection type is `polytomic_harbor`. Customer-managed Harbor backings return
6992
+ an unsupported-backing error.
6993
+
6994
+ The saved query receives a stable ID, but it remains absent from published
6995
+ saved-query reads until an administrator publishes its initial draft.
6996
+
6997
+ Use `{{parameter_name}}` references in `sql_template`. Each reference must have
6998
+ one scalar declaration. Validation values and defaults must match the declared
6999
+ `string`, `number`, `boolean`, `date`, `timestamp`, or `uuid` type.
7000
+
7001
+ Unknown JSON fields, including fields inside parameter declarations, return
7002
+ `400 Bad Request` before the draft is saved. Use `default_value`, not `default`,
7003
+ for parameter defaults.
7004
+
7005
+ When you omit a parameter during execution, Polytomic uses its published
7006
+ `default_value`, never its draft validation value. An omitted optional parameter
7007
+ without a default binds SQL `NULL`. A required parameter allows omission when a
7008
+ default exists, but rejects explicit `null` even with a default.
7009
+
7010
+ For a report window, use a required parameter with a default so omission selects
7011
+ a useful window and explicit `null` is rejected:
7012
+
7013
+ ```json
7014
+ {"name": "days", "type": "number", "required": true, "default_value": 7}
7015
+ ```
7016
+ </dd>
7017
+ </dl>
7018
+ </dd>
7019
+ </dl>
7020
+
7021
+ #### 🔌 Usage
7022
+
7023
+ <dl>
7024
+ <dd>
7025
+
7026
+ <dl>
7027
+ <dd>
7028
+
7029
+ ```typescript
7030
+ await client.harbors.createSavedQueryDraft("248df4b7-aa70-47b8-a036-33ac447e668d", {
7031
+ name: "Monthly revenue",
7032
+ sql_template: "SELECT account_id, sum(amount) AS revenue FROM orders WHERE created_at >= {{start_date}} GROUP BY account_id"
7033
+ });
7034
+
7035
+ ```
7036
+ </dd>
7037
+ </dl>
7038
+ </dd>
7039
+ </dl>
7040
+
7041
+ #### ⚙️ Parameters
7042
+
7043
+ <dl>
7044
+ <dd>
7045
+
7046
+ <dl>
7047
+ <dd>
7048
+
7049
+ **harbor_id:** `string` — Unique identifier of the Harbor.
7050
+
7051
+ </dd>
7052
+ </dl>
7053
+
7054
+ <dl>
7055
+ <dd>
7056
+
7057
+ **request:** `Polytomic.CreateHarborSavedQueryDraftRequest`
7058
+
7059
+ </dd>
7060
+ </dl>
7061
+
7062
+ <dl>
7063
+ <dd>
7064
+
7065
+ **requestOptions:** `HarborsClient.IdempotentRequestOptions`
7066
+
7067
+ </dd>
7068
+ </dl>
7069
+ </dd>
7070
+ </dl>
7071
+
7072
+
7073
+ </dd>
7074
+ </dl>
7075
+ </details>
7076
+
7077
+ <details><summary><code>client.harbors.<a href="/src/api/resources/harbors/client/Client.ts">listSavedQueryDrafts</a>(harbor_id, { ...params }) -> Polytomic.HarborSavedQueryDraftListEnvelope</code></summary>
7078
+ <dl>
7079
+ <dd>
7080
+
7081
+ #### 📝 Description
7082
+
7083
+ <dl>
7084
+ <dd>
7085
+
7086
+ <dl>
7087
+ <dd>
7088
+
7089
+ Lists mutable Harbor saved-query drafts.
7090
+
7091
+ Drafts are ordered from newest to oldest and include complete SQL, typed
7092
+ parameter declarations, and author-supplied validation values. Harbor profile
7093
+ credentials cannot access this endpoint.
7094
+ </dd>
7095
+ </dl>
7096
+ </dd>
7097
+ </dl>
7098
+
7099
+ #### 🔌 Usage
7100
+
7101
+ <dl>
7102
+ <dd>
7103
+
7104
+ <dl>
7105
+ <dd>
7106
+
7107
+ ```typescript
7108
+ await client.harbors.listSavedQueryDrafts("248df4b7-aa70-47b8-a036-33ac447e668d", {
7109
+ limit: 1,
7110
+ page_token: "page_token"
7111
+ });
7112
+
7113
+ ```
7114
+ </dd>
7115
+ </dl>
7116
+ </dd>
7117
+ </dl>
7118
+
7119
+ #### ⚙️ Parameters
7120
+
7121
+ <dl>
7122
+ <dd>
7123
+
7124
+ <dl>
7125
+ <dd>
7126
+
7127
+ **harbor_id:** `string` — Unique identifier of the Harbor.
7128
+
7129
+ </dd>
7130
+ </dl>
7131
+
7132
+ <dl>
7133
+ <dd>
7134
+
7135
+ **request:** `Polytomic.HarborsListSavedQueryDraftsRequest`
7136
+
7137
+ </dd>
7138
+ </dl>
7139
+
7140
+ <dl>
7141
+ <dd>
7142
+
7143
+ **requestOptions:** `HarborsClient.RequestOptions`
7144
+
7145
+ </dd>
7146
+ </dl>
7147
+ </dd>
7148
+ </dl>
7149
+
7150
+
7151
+ </dd>
7152
+ </dl>
7153
+ </details>
7154
+
7155
+ <details><summary><code>client.harbors.<a href="/src/api/resources/harbors/client/Client.ts">getSavedQuery</a>(harbor_id, saved_query_id, { ...params }) -> Polytomic.HarborSavedQueryEnvelope</code></summary>
7156
+ <dl>
7157
+ <dd>
7158
+
7159
+ #### 📝 Description
7160
+
7161
+ <dl>
7162
+ <dd>
7163
+
7164
+ <dl>
7165
+ <dd>
7166
+
7167
+ Returns the current published version of one Harbor saved query.
7168
+
7169
+ The response contains the current immutable `revision_id`, SQL template,
7170
+ parameter contract, expected columns, and publication provenance. Validation
7171
+ inputs are draft-only and are never part of a published response.
7172
+
7173
+ A Harbor profile credential can retrieve a saved query only from its own Harbor.
7174
+
7175
+ ## Harbor Activity
7176
+
7177
+ When you use a Harbor profile credential, send a new nonzero UUID in
7178
+ `X-Polytomic-Activity-Request-ID` for each request. A missing or invalid ID
7179
+ returns `400 Bad Request`. Reusing a consumed ID returns `409 Conflict`.
7180
+
7181
+ If you supply `X-Polytomic-Harbor-Session`, the session must be active and bound
7182
+ to your credential and Harbor. An invalid session returns `403 Forbidden`.
7183
+ Direct scoped REST requests may omit the session header.
7184
+
7185
+ Polytomic records `saved_query.fetched` before returning the definition. The
7186
+ event identifies the saved query, exact immutable revision, published version,
7187
+ and bounded name snapshot. It does not indicate query execution. Activity
7188
+ excludes SQL, parameter defaults and validation values, expected column names,
7189
+ and result rows. If Polytomic cannot record the event, the request returns
7190
+ `503 Service Unavailable` without saved-query data.
7191
+ </dd>
7192
+ </dl>
7193
+ </dd>
7194
+ </dl>
7195
+
7196
+ #### 🔌 Usage
7197
+
7198
+ <dl>
7199
+ <dd>
7200
+
7201
+ <dl>
7202
+ <dd>
7203
+
7204
+ ```typescript
7205
+ await client.harbors.getSavedQuery("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");
7206
+
7207
+ ```
7208
+ </dd>
7209
+ </dl>
7210
+ </dd>
7211
+ </dl>
7212
+
7213
+ #### ⚙️ Parameters
7214
+
7215
+ <dl>
7216
+ <dd>
7217
+
7218
+ <dl>
7219
+ <dd>
7220
+
7221
+ **harbor_id:** `string` — Unique identifier of the Harbor.
7222
+
7223
+ </dd>
7224
+ </dl>
7225
+
7226
+ <dl>
7227
+ <dd>
7228
+
7229
+ **saved_query_id:** `string` — Unique stable identifier of the saved query.
7230
+
7231
+ </dd>
7232
+ </dl>
7233
+
7234
+ <dl>
7235
+ <dd>
7236
+
7237
+ **request:** `Polytomic.HarborsGetSavedQueryRequest`
7238
+
7239
+ </dd>
7240
+ </dl>
7241
+
7242
+ <dl>
7243
+ <dd>
7244
+
7245
+ **requestOptions:** `HarborsClient.RequestOptions`
7246
+
7247
+ </dd>
7248
+ </dl>
7249
+ </dd>
7250
+ </dl>
7251
+
7252
+
7253
+ </dd>
7254
+ </dl>
7255
+ </details>
7256
+
7257
+ <details><summary><code>client.harbors.<a href="/src/api/resources/harbors/client/Client.ts">deleteSavedQuery</a>(harbor_id, saved_query_id) -> Polytomic.DeletedHarborSavedQueryEnvelope</code></summary>
7258
+ <dl>
7259
+ <dd>
7260
+
7261
+ #### 📝 Description
7262
+
7263
+ <dl>
7264
+ <dd>
7265
+
7266
+ <dl>
7267
+ <dd>
7268
+
7269
+ Archives one Harbor saved query and removes it from active reads.
7270
+
7271
+ Archiving removes the saved query and any draft from active reads while
7272
+ retaining its immutable revisions for provenance. The operation does not run
7273
+ the saved SQL or modify the Harbor backing Connection. Archiving does not cancel
7274
+ in-flight execution requests or queued executions.
7275
+
7276
+ This REST operation archives the saved query; it does not merely unpublish it.
7277
+ Unpublish is available only through the GraphQL `unpublishHarborSavedQuery`
7278
+ mutation. There is no REST unpublish endpoint.
7279
+ </dd>
7280
+ </dl>
7281
+ </dd>
7282
+ </dl>
7283
+
7284
+ #### 🔌 Usage
7285
+
7286
+ <dl>
7287
+ <dd>
7288
+
7289
+ <dl>
7290
+ <dd>
7291
+
7292
+ ```typescript
7293
+ await client.harbors.deleteSavedQuery("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");
7294
+
7295
+ ```
7296
+ </dd>
7297
+ </dl>
7298
+ </dd>
7299
+ </dl>
7300
+
7301
+ #### ⚙️ Parameters
7302
+
7303
+ <dl>
7304
+ <dd>
7305
+
7306
+ <dl>
7307
+ <dd>
7308
+
7309
+ **harbor_id:** `string` — Unique identifier of the Harbor.
7310
+
7311
+ </dd>
7312
+ </dl>
7313
+
7314
+ <dl>
7315
+ <dd>
7316
+
7317
+ **saved_query_id:** `string` — Unique stable identifier of the saved query.
7318
+
7319
+ </dd>
7320
+ </dl>
7321
+
7322
+ <dl>
7323
+ <dd>
7324
+
7325
+ **requestOptions:** `HarborsClient.IdempotentRequestOptions`
7326
+
7327
+ </dd>
7328
+ </dl>
7329
+ </dd>
7330
+ </dl>
7331
+
7332
+
7333
+ </dd>
7334
+ </dl>
7335
+ </details>
7336
+
7337
+ <details><summary><code>client.harbors.<a href="/src/api/resources/harbors/client/Client.ts">saveSavedQueryDraft</a>(harbor_id, saved_query_id, { ...params }) -> Polytomic.HarborSavedQueryDraftEnvelope</code></summary>
7338
+ <dl>
7339
+ <dd>
7340
+
7341
+ #### 📝 Description
7342
+
7343
+ <dl>
7344
+ <dd>
7345
+
7346
+ <dl>
7347
+ <dd>
7348
+
7349
+ Creates or completely replaces the mutable draft for a Harbor saved query.
7350
+
7351
+ Replacement is complete rather than partial. The next validation or publication
7352
+ uses the replacement SQL, parameter declarations, and validation values.
7353
+
7354
+ Unknown JSON fields, including fields inside parameter declarations, return
7355
+ `400 Bad Request` before the draft is saved. Use `default_value`, not `default`,
7356
+ for parameter defaults.
7357
+
7358
+ When you omit a parameter during execution, Polytomic uses its published
7359
+ `default_value`, never its draft validation value. An omitted optional parameter
7360
+ without a default binds SQL `NULL`. A required parameter allows omission when a
7361
+ default exists, but rejects explicit `null` even with a default.
7362
+
7363
+ For a report window, use a required parameter with a default so omission selects
7364
+ a useful window and explicit `null` is rejected:
7365
+
7366
+ ```json
7367
+ {"name": "days", "type": "number", "required": true, "default_value": 7}
7368
+ ```
7369
+ </dd>
7370
+ </dl>
7371
+ </dd>
7372
+ </dl>
7373
+
7374
+ #### 🔌 Usage
7375
+
7376
+ <dl>
7377
+ <dd>
7378
+
7379
+ <dl>
7380
+ <dd>
7381
+
7382
+ ```typescript
7383
+ await client.harbors.saveSavedQueryDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
7384
+ name: "Monthly revenue",
7385
+ sql_template: "SELECT account_id, sum(amount) AS revenue FROM orders WHERE created_at >= {{start_date}} GROUP BY account_id"
7386
+ });
7387
+
7388
+ ```
7389
+ </dd>
7390
+ </dl>
7391
+ </dd>
7392
+ </dl>
7393
+
7394
+ #### ⚙️ Parameters
7395
+
7396
+ <dl>
7397
+ <dd>
7398
+
7399
+ <dl>
7400
+ <dd>
7401
+
7402
+ **harbor_id:** `string` — Unique identifier of the Harbor.
7403
+
7404
+ </dd>
7405
+ </dl>
7406
+
7407
+ <dl>
7408
+ <dd>
7409
+
7410
+ **saved_query_id:** `string` — Unique stable identifier of the saved query.
7411
+
7412
+ </dd>
7413
+ </dl>
7414
+
7415
+ <dl>
7416
+ <dd>
7417
+
7418
+ **request:** `Polytomic.SaveHarborSavedQueryDraftRequest`
7419
+
7420
+ </dd>
7421
+ </dl>
7422
+
7423
+ <dl>
7424
+ <dd>
7425
+
7426
+ **requestOptions:** `HarborsClient.IdempotentRequestOptions`
7427
+
7428
+ </dd>
7429
+ </dl>
7430
+ </dd>
7431
+ </dl>
7432
+
7433
+
7434
+ </dd>
7435
+ </dl>
7436
+ </details>
7437
+
7438
+ <details><summary><code>client.harbors.<a href="/src/api/resources/harbors/client/Client.ts">deleteSavedQueryDraft</a>(harbor_id, saved_query_id) -> Polytomic.DeletedHarborSavedQueryDraftEnvelope</code></summary>
7439
+ <dl>
7440
+ <dd>
7441
+
7442
+ #### 📝 Description
7443
+
7444
+ <dl>
7445
+ <dd>
7446
+
7447
+ <dl>
7448
+ <dd>
7449
+
7450
+ Discards the mutable draft for one Harbor saved query.
7451
+
7452
+ Discarding an initial unpublished draft also removes its otherwise empty stable
7453
+ saved-query identity. Discarding a later draft preserves every immutable
7454
+ published version.
7455
+ </dd>
7456
+ </dl>
7457
+ </dd>
7458
+ </dl>
7459
+
7460
+ #### 🔌 Usage
7461
+
7462
+ <dl>
7463
+ <dd>
7464
+
7465
+ <dl>
7466
+ <dd>
7467
+
7468
+ ```typescript
7469
+ await client.harbors.deleteSavedQueryDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");
7470
+
7471
+ ```
7472
+ </dd>
7473
+ </dl>
7474
+ </dd>
7475
+ </dl>
7476
+
7477
+ #### ⚙️ Parameters
7478
+
7479
+ <dl>
7480
+ <dd>
7481
+
7482
+ <dl>
7483
+ <dd>
7484
+
7485
+ **harbor_id:** `string` — Unique identifier of the Harbor.
7486
+
7487
+ </dd>
7488
+ </dl>
7489
+
7490
+ <dl>
7491
+ <dd>
7492
+
7493
+ **saved_query_id:** `string` — Unique stable identifier of the saved query.
7494
+
7495
+ </dd>
7496
+ </dl>
7497
+
7498
+ <dl>
7499
+ <dd>
7500
+
7501
+ **requestOptions:** `HarborsClient.IdempotentRequestOptions`
7502
+
7503
+ </dd>
7504
+ </dl>
7505
+ </dd>
7506
+ </dl>
7507
+
7508
+
7509
+ </dd>
7510
+ </dl>
7511
+ </details>
7512
+
7513
+ <details><summary><code>client.harbors.<a href="/src/api/resources/harbors/client/Client.ts">publishSavedQueryDraft</a>(harbor_id, saved_query_id) -> Polytomic.HarborSavedQueryEnvelope</code></summary>
7514
+ <dl>
7515
+ <dd>
7516
+
7517
+ #### 📝 Description
7518
+
7519
+ <dl>
7520
+ <dd>
7521
+
7522
+ <dl>
7523
+ <dd>
7524
+
7525
+ Validates and publishes the current draft as the next immutable saved-query version.
7526
+
7527
+ Only organization administrators can publish. Publication executes and validates
7528
+ the current draft with the Polytomic-managed Harbor's MotherDuck `read_scaling`
7529
+ credential. It fails instead of using the Harbor writer credential when the
7530
+ reader credential is missing or incomplete.
7531
+
7532
+ After execution, publication verifies that the draft did not change. A
7533
+ concurrent edit returns a conflict and remains a draft. Successful publication
7534
+ creates the next immutable revision, records the observed ordered columns as its
7535
+ output contract, removes validation inputs from the published definition, and
7536
+ deletes the mutable draft. The response includes the immutable `revision_id`
7537
+ that future executions use for exact provenance.
7538
+ </dd>
7539
+ </dl>
7540
+ </dd>
7541
+ </dl>
7542
+
7543
+ #### 🔌 Usage
7544
+
7545
+ <dl>
7546
+ <dd>
7547
+
7548
+ <dl>
7549
+ <dd>
7550
+
7551
+ ```typescript
7552
+ await client.harbors.publishSavedQueryDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");
7553
+
7554
+ ```
7555
+ </dd>
7556
+ </dl>
7557
+ </dd>
7558
+ </dl>
7559
+
7560
+ #### ⚙️ Parameters
7561
+
7562
+ <dl>
7563
+ <dd>
7564
+
7565
+ <dl>
7566
+ <dd>
7567
+
7568
+ **harbor_id:** `string` — Unique identifier of the Harbor.
7569
+
7570
+ </dd>
7571
+ </dl>
7572
+
7573
+ <dl>
7574
+ <dd>
7575
+
7576
+ **saved_query_id:** `string` — Unique stable identifier of the saved query.
7577
+
7578
+ </dd>
7579
+ </dl>
7580
+
7581
+ <dl>
7582
+ <dd>
7583
+
7584
+ **requestOptions:** `HarborsClient.IdempotentRequestOptions`
7585
+
7586
+ </dd>
7587
+ </dl>
7588
+ </dd>
7589
+ </dl>
7590
+
7591
+
7592
+ </dd>
7593
+ </dl>
7594
+ </details>
7595
+
7596
+ <details><summary><code>client.harbors.<a href="/src/api/resources/harbors/client/Client.ts">validateSavedQueryDraft</a>(harbor_id, saved_query_id) -> Polytomic.HarborSavedQueryValidationEnvelope</code></summary>
7597
+ <dl>
7598
+ <dd>
7599
+
7600
+ #### 📝 Description
7601
+
7602
+ <dl>
7603
+ <dd>
7604
+
7605
+ <dl>
7606
+ <dd>
7607
+
7608
+ Validates the exact current saved-query draft and returns a bounded ephemeral preview.
7609
+
7610
+ Only organization administrators can validate drafts. Named template references
7611
+ compile to DuckDB placeholders, and typed values are passed separately rather
7612
+ than interpolated into SQL.
7613
+
7614
+ The query runs with the Polytomic-managed Harbor's MotherDuck `read_scaling`
7615
+ credential. Validation fails when that credential is missing or incomplete and
7616
+ never falls back to the Harbor writer credential. Preview rows and serialized
7617
+ response size are bounded. The preview and validation attempt are not persisted.
7618
+ </dd>
7619
+ </dl>
7620
+ </dd>
7621
+ </dl>
7622
+
7623
+ #### 🔌 Usage
7624
+
7625
+ <dl>
7626
+ <dd>
7627
+
7628
+ <dl>
7629
+ <dd>
7630
+
7631
+ ```typescript
7632
+ await client.harbors.validateSavedQueryDraft("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");
7633
+
7634
+ ```
7635
+ </dd>
7636
+ </dl>
7637
+ </dd>
7638
+ </dl>
7639
+
7640
+ #### ⚙️ Parameters
7641
+
7642
+ <dl>
7643
+ <dd>
7644
+
7645
+ <dl>
7646
+ <dd>
7647
+
7648
+ **harbor_id:** `string` — Unique identifier of the Harbor.
7649
+
7650
+ </dd>
7651
+ </dl>
7652
+
7653
+ <dl>
7654
+ <dd>
7655
+
7656
+ **saved_query_id:** `string` — Unique stable identifier of the saved query.
7657
+
7658
+ </dd>
7659
+ </dl>
7660
+
7661
+ <dl>
7662
+ <dd>
7663
+
7664
+ **requestOptions:** `HarborsClient.IdempotentRequestOptions`
7665
+
7666
+ </dd>
7667
+ </dl>
7668
+ </dd>
7669
+ </dl>
7670
+
7671
+
7672
+ </dd>
7673
+ </dl>
7674
+ </details>
7675
+
7676
+ <details><summary><code>client.harbors.<a href="/src/api/resources/harbors/client/Client.ts">executeSavedQuery</a>(harbor_id, saved_query_id, { ...params }) -> Polytomic.ExecuteHarborSavedQueryEnvelope</code></summary>
7677
+ <dl>
7678
+ <dd>
7679
+
7680
+ #### 📝 Description
7681
+
7682
+ <dl>
7683
+ <dd>
7684
+
7685
+ <dl>
7686
+ <dd>
7687
+
7688
+ Submits the current published Harbor saved query for asynchronous reader-only execution.
7689
+
7690
+ Use a Harbor-bound scoped credential with query access to the Harbor's backing
7691
+ Connection. Administrator credentials cannot submit executions here. Saved
7692
+ queries require a Polytomic-managed Harbor.
7693
+
7694
+ Polytomic selects the current published revision while processing your request.
7695
+ The response identifies that exact immutable revision. Selection happens before
7696
+ Polytomic accepts the execution. Drafts, unpublished queries, and archived
7697
+ queries are unavailable for selection. You cannot select a historical revision
7698
+ or supply SQL through this endpoint.
7699
+
7700
+ > ⚠️ Concurrent publication changes
7701
+ >
7702
+ > Publishing, unpublishing, or archiving a saved query after selection does not
7703
+ > change the selected revision. An in-flight request may still be accepted and
7704
+ > execute that revision. Unpublishing or archiving does not cancel in-flight
7705
+ > requests or queued executions. Query access is checked again before execution
7706
+ > and result retrieval.
7707
+
7708
+ Parameter values are bound separately from SQL. Omitted parameters use the
7709
+ published `default_value`, never draft validation values. An omitted optional
7710
+ parameter without a default binds SQL `NULL`. Required parameters allow omission
7711
+ when a default exists, but reject explicit `null` even with a default. Missing
7712
+ required values without defaults, explicit `null` for required parameters,
7713
+ unknown parameter names, and invalid scalar types return
7714
+ `422 Unprocessable Entity` without accepting an execution. Execution requires
7715
+ reader credentials and never falls back to writer credentials.
7716
+
7717
+ For report windows, define parameters with `required: true` and a
7718
+ `default_value`, such as `7` for a `days` parameter. This allows omission while
7719
+ preventing explicit `null` from turning a time filter into a SQL `NULL`
7720
+ comparison.
7721
+
7722
+ To archive a saved query through REST, use
7723
+ [`DELETE /api/harbors/{harbor_id}/saved-queries/{saved_query_id}`](../../../../../../api-reference/harbors/delete-saved-query).
7724
+ Unpublish is available only through the GraphQL `unpublishHarborSavedQuery`
7725
+ mutation, not a REST endpoint.
7726
+
7727
+ ## Results
7728
+
7729
+ The response returns a task ID with status `created`, not result rows. Poll
7730
+ [`GET /api/queries/{id}`](../../../../../../api-reference/query-runner/get-query) using a credential
7731
+ from the same Harbor profile. Query access is checked again before execution and
7732
+ result retrieval. Stop polling at `done`, `failed`, or `unknown`; `unknown` means
7733
+ execution started but no durable terminal result is available.
7734
+
7735
+ Results and detailed failure information expire after 24 hours. Use the
7736
+ `expires` field and follow `links.next` to retrieve additional result pages.
7737
+
7738
+ ## Harbor Activity
7739
+
7740
+ Send a new nonzero UUID in `X-Polytomic-Activity-Request-ID`. Missing or invalid
7741
+ IDs return `400 Bad Request`. Reusing a consumed ID returns `409 Conflict` and
7742
+ does not create another execution.
7743
+
7744
+ You may omit `X-Polytomic-Harbor-Session` for direct REST requests. If supplied,
7745
+ the session must be active and bound to your credential and Harbor.
7746
+
7747
+ Polytomic records `query.submitted` atomically with acceptance. The event
7748
+ identifies the saved query, immutable revision, published version, and bounded
7749
+ name snapshot. SQL, parameter values and defaults, column names, and result rows
7750
+ remain outside Activity metadata. If Activity persistence is unavailable, the
7751
+ request returns `503 Service Unavailable` without accepting an execution.
7752
+
7753
+ `query.started` records provider invocation. `query.succeeded` means results are
7754
+ available for authorized retrieval, not that you have consumed them.
7755
+ </dd>
7756
+ </dl>
7757
+ </dd>
7758
+ </dl>
7759
+
7760
+ #### 🔌 Usage
7761
+
7762
+ <dl>
7763
+ <dd>
7764
+
7765
+ <dl>
7766
+ <dd>
7767
+
7768
+ ```typescript
7769
+ await client.harbors.executeSavedQuery("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d");
7770
+
7771
+ ```
7772
+ </dd>
7773
+ </dl>
7774
+ </dd>
7775
+ </dl>
7776
+
7777
+ #### ⚙️ Parameters
7778
+
7779
+ <dl>
7780
+ <dd>
7781
+
7782
+ <dl>
7783
+ <dd>
7784
+
7785
+ **harbor_id:** `string` — Unique identifier of the Harbor.
7786
+
7787
+ </dd>
7788
+ </dl>
7789
+
7790
+ <dl>
7791
+ <dd>
7792
+
7793
+ **saved_query_id:** `string` — Unique stable identifier of the saved query.
7794
+
7795
+ </dd>
7796
+ </dl>
7797
+
7798
+ <dl>
7799
+ <dd>
7800
+
7801
+ **request:** `Polytomic.ExecuteHarborSavedQueryRequest`
7802
+
7803
+ </dd>
7804
+ </dl>
7805
+
7806
+ <dl>
7807
+ <dd>
7808
+
7809
+ **requestOptions:** `HarborsClient.IdempotentRequestOptions`
7810
+
7811
+ </dd>
7812
+ </dl>
7813
+ </dd>
7814
+ </dl>
7815
+
7816
+
6863
7817
  </dd>
6864
7818
  </dl>
6865
7819
  </details>