@datocms/cma-client 3.3.5 → 3.3.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.
package/resources.json CHANGED
@@ -3008,7 +3008,8 @@
3008
3008
  "http_basic_password",
3009
3009
  "enabled",
3010
3010
  "payload_api_version",
3011
- "nested_items_in_payload"
3011
+ "nested_items_in_payload",
3012
+ "auto_retry"
3012
3013
  ],
3013
3014
  "relationships": []
3014
3015
  },
@@ -3051,7 +3052,8 @@
3051
3052
  "http_basic_password",
3052
3053
  "enabled",
3053
3054
  "payload_api_version",
3054
- "nested_items_in_payload"
3055
+ "nested_items_in_payload",
3056
+ "auto_retry"
3055
3057
  ],
3056
3058
  "relationships": []
3057
3059
  },
@@ -3150,6 +3152,31 @@
3150
3152
  "name": "list",
3151
3153
  "rawName": "rawList"
3152
3154
  },
3155
+ {
3156
+ "returnsCollection": false,
3157
+ "docUrl": "https://www.datocms.com/docs/content-management-api/resources/webhook-call/self",
3158
+ "rel": "self",
3159
+ "urlTemplate": "/webhook_calls/${webhookCallId}",
3160
+ "method": "GET",
3161
+ "comment": "Retrieve a webhook call",
3162
+ "urlPlaceholders": [
3163
+ {
3164
+ "variableName": "webhookCallId",
3165
+ "isEntityId": true,
3166
+ "relType": "WebhookCallData"
3167
+ }
3168
+ ],
3169
+ "entityIdPlaceholder": {
3170
+ "variableName": "webhookCallId",
3171
+ "isEntityId": true,
3172
+ "relType": "WebhookCallData"
3173
+ },
3174
+ "optionalRequestBody": false,
3175
+ "queryParamsRequired": false,
3176
+ "responseType": "WebhookCallSelfTargetSchema",
3177
+ "name": "find",
3178
+ "rawName": "rawFind"
3179
+ },
3153
3180
  {
3154
3181
  "returnsCollection": false,
3155
3182
  "docUrl": "https://www.datocms.com/docs/content-management-api/resources/webhook-call/resend_webhook",
@@ -145,7 +145,7 @@ export class Client {
145
145
  ...this.config,
146
146
  ...options,
147
147
  logFn: this.config.logFn || console.log,
148
- userAgent: '@datocms/cma-client v3.3.5',
148
+ userAgent: '@datocms/cma-client v3.3.7',
149
149
  baseUrl: this.baseUrl,
150
150
  preCallStack: new Error().stack,
151
151
  extraHeaders: {
@@ -564,7 +564,6 @@ export type ItemInstancesHrefSchema = {
564
564
  * The maximum number of entities to return (defaults to 30, maximum is 500)
565
565
  */
566
566
  limit?: number;
567
- [k: string]: unknown;
568
567
  };
569
568
  /**
570
569
  * Fields used to order results. You **must** specify also `filter[type]` with one element only to be able use this option. Format: `<field_name>_(ASC|DESC)`, where `<field_name>` can be either the API key of a model's field, or one of the following meta columns: `id`, `_updated_at`, `_created_at`, `_status`, `_published_at`, `_first_published_at`, `_publication_scheduled_at`, `_unpublishing_scheduled_at`, `_is_valid`, `position` (only for sortable models). You can pass multiple comma separated rules.
@@ -687,7 +686,6 @@ export type ItemVersionInstancesHrefSchema = {
687
686
  * The maximum number of entities to return (defaults to 15, maximum is 50)
688
687
  */
689
688
  limit?: number;
690
- [k: string]: unknown;
691
689
  };
692
690
  [k: string]: unknown;
693
691
  };
@@ -840,7 +838,6 @@ export type UploadInstancesHrefSchema = {
840
838
  * The maximum number of entities to return (defaults to 30, maximum is 500)
841
839
  */
842
840
  limit?: number;
843
- [k: string]: unknown;
844
841
  };
845
842
  [k: string]: unknown;
846
843
  };
@@ -943,7 +940,6 @@ export type SearchResultInstancesHrefSchema = {
943
940
  * The maximum number of entities to return (defaults to 20, maximum is 100)
944
941
  */
945
942
  limit?: number;
946
- [k: string]: unknown;
947
943
  };
948
944
  /**
949
945
  * Attributes to filter search results
@@ -1066,8 +1062,82 @@ export type WebhookCallInstancesHrefSchema = {
1066
1062
  * The maximum number of entities to return (defaults to 30, maximum is 500)
1067
1063
  */
1068
1064
  limit?: number;
1069
- [k: string]: unknown;
1070
1065
  };
1066
+ /**
1067
+ * Attributes to filter
1068
+ */
1069
+ filter?: {
1070
+ /**
1071
+ * IDs to fetch, comma separated
1072
+ */
1073
+ ids?: string;
1074
+ fields?: {
1075
+ webhook_id?: {
1076
+ eq?: string;
1077
+ };
1078
+ entity_type?: {
1079
+ /**
1080
+ * The subject of webhook triggering
1081
+ */
1082
+ eq?:
1083
+ | 'item_type'
1084
+ | 'item'
1085
+ | 'upload'
1086
+ | 'build_trigger'
1087
+ | 'environment'
1088
+ | 'maintenance_mode'
1089
+ | 'sso_user'
1090
+ | 'cda_cache_tags';
1091
+ };
1092
+ event_type?: {
1093
+ /**
1094
+ * The event that triggers the webhook call
1095
+ */
1096
+ eq?:
1097
+ | 'create'
1098
+ | 'update'
1099
+ | 'delete'
1100
+ | 'publish'
1101
+ | 'unpublish'
1102
+ | 'promote'
1103
+ | 'deploy_started'
1104
+ | 'deploy_succeeded'
1105
+ | 'deploy_failed'
1106
+ | 'change'
1107
+ | 'invalidate';
1108
+ };
1109
+ status?: {
1110
+ /**
1111
+ * The current status
1112
+ */
1113
+ eq?: 'pending' | 'success' | 'failed' | 'rescheduled';
1114
+ };
1115
+ last_sent_at?: {
1116
+ gt?: string;
1117
+ lt?: string;
1118
+ };
1119
+ next_retry_at?: {
1120
+ gt?: string;
1121
+ lt?: string;
1122
+ };
1123
+ created_at?: {
1124
+ gt?: string;
1125
+ lt?: string;
1126
+ };
1127
+ };
1128
+ };
1129
+ /**
1130
+ * Fields used to order results
1131
+ */
1132
+ order_by?:
1133
+ | 'webhook_id_asc'
1134
+ | 'webhook_id_desc'
1135
+ | 'created_at_asc'
1136
+ | 'created_at_desc'
1137
+ | 'last_sent_at_asc'
1138
+ | 'last_sent_at_desc'
1139
+ | 'next_retry_at_asc'
1140
+ | 'next_retry_at_desc';
1071
1141
  [k: string]: unknown;
1072
1142
  };
1073
1143
  /**
@@ -1302,7 +1372,6 @@ export type UploadTagInstancesHrefSchema = {
1302
1372
  * The maximum number of entities to return (defaults to 50, maximum is 500)
1303
1373
  */
1304
1374
  limit?: number;
1305
- [k: string]: unknown;
1306
1375
  };
1307
1376
  [k: string]: unknown;
1308
1377
  };
@@ -1348,7 +1417,6 @@ export type UploadSmartTagInstancesHrefSchema = {
1348
1417
  * The maximum number of entities to return (defaults to 50, maximum is 500)
1349
1418
  */
1350
1419
  limit?: number;
1351
- [k: string]: unknown;
1352
1420
  };
1353
1421
  [k: string]: unknown;
1354
1422
  };
@@ -8873,12 +8941,46 @@ export type WebhookAttributes = {
8873
8941
  * Additional headers that will be sent
8874
8942
  */
8875
8943
  headers: {
8876
- [k: string]: unknown;
8877
- };
8878
- /**
8879
- * All the events you will be notified for
8880
- */
8881
- events: unknown[];
8944
+ [k: string]: string;
8945
+ };
8946
+ events: {
8947
+ /**
8948
+ * The subject of webhook triggering
8949
+ */
8950
+ entity_type:
8951
+ | 'item_type'
8952
+ | 'item'
8953
+ | 'upload'
8954
+ | 'build_trigger'
8955
+ | 'environment'
8956
+ | 'maintenance_mode'
8957
+ | 'sso_user'
8958
+ | 'cda_cache_tags';
8959
+ event_types: (
8960
+ | 'create'
8961
+ | 'update'
8962
+ | 'delete'
8963
+ | 'publish'
8964
+ | 'unpublish'
8965
+ | 'promote'
8966
+ | 'deploy_started'
8967
+ | 'deploy_succeeded'
8968
+ | 'deploy_failed'
8969
+ | 'change'
8970
+ | 'invalidate'
8971
+ )[];
8972
+ filters?:
8973
+ | {
8974
+ entity_type:
8975
+ | 'item_type'
8976
+ | 'item'
8977
+ | 'build_trigger'
8978
+ | 'environment'
8979
+ | 'environment_type';
8980
+ entity_ids: [string, ...string[]];
8981
+ }[]
8982
+ | null;
8983
+ }[];
8882
8984
  /**
8883
8985
  * Specifies which API version to use when serializing entities in the webhook payload
8884
8986
  */
@@ -8887,6 +8989,10 @@ export type WebhookAttributes = {
8887
8989
  * Whether the you want records present in the payload to show blocks expanded or not
8888
8990
  */
8889
8991
  nested_items_in_payload: boolean;
8992
+ /**
8993
+ * If enabled, the system will attempt to retry the call several times when the webhook operation fails due to timeouts or errors.
8994
+ */
8995
+ auto_retry: boolean;
8890
8996
  };
8891
8997
 
8892
8998
  /**
@@ -8924,12 +9030,46 @@ export type WebhookCreateSchema = {
8924
9030
  * Additional headers that will be sent
8925
9031
  */
8926
9032
  headers: {
8927
- [k: string]: unknown;
9033
+ [k: string]: string;
8928
9034
  };
8929
- /**
8930
- * All the events you will be notified for
8931
- */
8932
- events: unknown[];
9035
+ events: {
9036
+ /**
9037
+ * The subject of webhook triggering
9038
+ */
9039
+ entity_type:
9040
+ | 'item_type'
9041
+ | 'item'
9042
+ | 'upload'
9043
+ | 'build_trigger'
9044
+ | 'environment'
9045
+ | 'maintenance_mode'
9046
+ | 'sso_user'
9047
+ | 'cda_cache_tags';
9048
+ event_types: (
9049
+ | 'create'
9050
+ | 'update'
9051
+ | 'delete'
9052
+ | 'publish'
9053
+ | 'unpublish'
9054
+ | 'promote'
9055
+ | 'deploy_started'
9056
+ | 'deploy_succeeded'
9057
+ | 'deploy_failed'
9058
+ | 'change'
9059
+ | 'invalidate'
9060
+ )[];
9061
+ filters?:
9062
+ | {
9063
+ entity_type:
9064
+ | 'item_type'
9065
+ | 'item'
9066
+ | 'build_trigger'
9067
+ | 'environment'
9068
+ | 'environment_type';
9069
+ entity_ids: [string, ...string[]];
9070
+ }[]
9071
+ | null;
9072
+ }[];
8933
9073
  /**
8934
9074
  * HTTP Basic Authorization username
8935
9075
  */
@@ -8950,6 +9090,10 @@ export type WebhookCreateSchema = {
8950
9090
  * Whether the you want records present in the payload to show blocks expanded or not
8951
9091
  */
8952
9092
  nested_items_in_payload?: boolean;
9093
+ /**
9094
+ * If enabled, the system will attempt to retry the call several times when the webhook operation fails due to timeouts or errors.
9095
+ */
9096
+ auto_retry?: boolean;
8953
9097
  };
8954
9098
  };
8955
9099
  };
@@ -8987,12 +9131,46 @@ export type WebhookUpdateSchema = {
8987
9131
  * Additional headers that will be sent
8988
9132
  */
8989
9133
  headers?: {
8990
- [k: string]: unknown;
9134
+ [k: string]: string;
8991
9135
  };
8992
- /**
8993
- * All the events you will be notified for
8994
- */
8995
- events?: unknown[];
9136
+ events?: {
9137
+ /**
9138
+ * The subject of webhook triggering
9139
+ */
9140
+ entity_type:
9141
+ | 'item_type'
9142
+ | 'item'
9143
+ | 'upload'
9144
+ | 'build_trigger'
9145
+ | 'environment'
9146
+ | 'maintenance_mode'
9147
+ | 'sso_user'
9148
+ | 'cda_cache_tags';
9149
+ event_types: (
9150
+ | 'create'
9151
+ | 'update'
9152
+ | 'delete'
9153
+ | 'publish'
9154
+ | 'unpublish'
9155
+ | 'promote'
9156
+ | 'deploy_started'
9157
+ | 'deploy_succeeded'
9158
+ | 'deploy_failed'
9159
+ | 'change'
9160
+ | 'invalidate'
9161
+ )[];
9162
+ filters?:
9163
+ | {
9164
+ entity_type:
9165
+ | 'item_type'
9166
+ | 'item'
9167
+ | 'build_trigger'
9168
+ | 'environment'
9169
+ | 'environment_type';
9170
+ entity_ids: [string, ...string[]];
9171
+ }[]
9172
+ | null;
9173
+ }[];
8996
9174
  /**
8997
9175
  * HTTP Basic Authorization username
8998
9176
  */
@@ -9013,6 +9191,10 @@ export type WebhookUpdateSchema = {
9013
9191
  * Whether the you want records present in the payload to show blocks expanded or not
9014
9192
  */
9015
9193
  nested_items_in_payload?: boolean;
9194
+ /**
9195
+ * If enabled, the system will attempt to retry the call several times when the webhook operation fails due to timeouts or errors.
9196
+ */
9197
+ auto_retry?: boolean;
9016
9198
  };
9017
9199
  };
9018
9200
  };
@@ -9072,13 +9254,32 @@ export type WebhookCallAttributes = {
9072
9254
  /**
9073
9255
  * The subject of webhook triggering
9074
9256
  */
9075
- entity_type: 'item' | 'item_type' | 'upload';
9257
+ entity_type:
9258
+ | 'item_type'
9259
+ | 'item'
9260
+ | 'upload'
9261
+ | 'build_trigger'
9262
+ | 'environment'
9263
+ | 'maintenance_mode'
9264
+ | 'sso_user'
9265
+ | 'cda_cache_tags';
9076
9266
  /**
9077
9267
  * The event that triggers the webhook call
9078
9268
  */
9079
- event_type: 'create' | 'update' | 'delete' | 'publish' | 'unpublish';
9080
- /**
9081
- * The moment the call occurred
9269
+ event_type:
9270
+ | 'create'
9271
+ | 'update'
9272
+ | 'delete'
9273
+ | 'publish'
9274
+ | 'unpublish'
9275
+ | 'promote'
9276
+ | 'deploy_started'
9277
+ | 'deploy_succeeded'
9278
+ | 'deploy_failed'
9279
+ | 'change'
9280
+ | 'invalidate';
9281
+ /**
9282
+ * The moment the event was created
9082
9283
  */
9083
9284
  created_at: string;
9084
9285
  /**
@@ -9104,11 +9305,27 @@ export type WebhookCallAttributes = {
9104
9305
  */
9105
9306
  response_headers: {
9106
9307
  [k: string]: unknown;
9107
- };
9308
+ } | null;
9108
9309
  /**
9109
9310
  * The body of the response
9110
9311
  */
9111
9312
  response_payload: string | null;
9313
+ /**
9314
+ * The number of retries attempted so far
9315
+ */
9316
+ attempted_auto_retries_count: number;
9317
+ /**
9318
+ * The last moment the call occurred
9319
+ */
9320
+ last_sent_at: string;
9321
+ /**
9322
+ * The date when the next retry attempt is scheduled to run. If no retry attempt is scheduled, it is set to null
9323
+ */
9324
+ next_retry_at: string | null;
9325
+ /**
9326
+ * The current status
9327
+ */
9328
+ status: 'pending' | 'success' | 'failed' | 'rescheduled';
9112
9329
  };
9113
9330
 
9114
9331
  /**
@@ -9146,6 +9363,16 @@ export type WebhookCallInstancesTargetSchema = {
9146
9363
  meta: {
9147
9364
  total_count: number;
9148
9365
  };
9366
+ included: Webhook[];
9367
+ };
9368
+
9369
+ /**
9370
+ * This interface was referenced by `WebhookCall`'s JSON-Schema
9371
+ * via the `self.targetSchema` link.
9372
+ */
9373
+ export type WebhookCallSelfTargetSchema = {
9374
+ data: WebhookCall;
9375
+ included: Webhook[];
9149
9376
  };
9150
9377
 
9151
9378
  /**