@duffel/api 4.25.0 → 4.26.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/dist/typings.d.ts CHANGED
@@ -154,6 +154,7 @@ declare module '@duffel/api/Stays/Stays' {
154
154
  import { Brands } from '@duffel/api/Stays/Brands';
155
155
  import { LoyaltyProgrammes } from '@duffel/api/Stays/LoyaltyProgrammes';
156
156
  import { Bookings } from '@duffel/api/Stays/Bookings';
157
+ import { NegotiatedRates } from '@duffel/api/Stays/NegotiatedRates';
157
158
  import { Quotes } from '@duffel/api/Stays/Quotes';
158
159
  import { SearchResults } from '@duffel/api/Stays/SearchResults';
159
160
  export class Stays extends Resource {
@@ -164,6 +165,7 @@ declare module '@duffel/api/Stays/Stays' {
164
165
  accommodation: Accommodation;
165
166
  loyaltyProgrammes: LoyaltyProgrammes;
166
167
  brands: Brands;
168
+ negotiatedRates: NegotiatedRates;
167
169
  searchResults: SearchResults;
168
170
  quotes: Quotes;
169
171
  bookings: Bookings;
@@ -617,7 +619,11 @@ declare module '@duffel/api/Stays/StaysTypes' {
617
619
  }
618
620
  export interface StaysChain {
619
621
  /**
620
- * The hotel chain’s name
622
+ * Duffel ID for this chain
623
+ */
624
+ id: string;
625
+ /**
626
+ * The hotel chain's name
621
627
  */
622
628
  name: string;
623
629
  }
@@ -1040,6 +1046,130 @@ declare module '@duffel/api/Stays/StaysTypes' {
1040
1046
  */
1041
1047
  user_id?: string;
1042
1048
  };
1049
+ /**
1050
+ * A negotiated rate that enables passing rate access codes for stays accommodation.
1051
+ * Can be associated with either a chain or specific accommodations, but not both.
1052
+ */
1053
+ export interface StaysNegotiatedRate {
1054
+ /**
1055
+ * The ID of the Negotiated Rate
1056
+ *
1057
+ * Example: "nre_0000AvtkNoC81yBytDM9PE"
1058
+ */
1059
+ id: string;
1060
+ /**
1061
+ * The rate access code to be utilised when using this negotiated rate
1062
+ *
1063
+ * Example: "DUFFEL"
1064
+ */
1065
+ rate_access_code: string;
1066
+ /**
1067
+ * The display name of the negotiated rate
1068
+ *
1069
+ * Example: "2025 Negotiated Rate"
1070
+ */
1071
+ display_name: string;
1072
+ /**
1073
+ * Whether this negotiated rate is for live mode. When false, it is for test mode
1074
+ *
1075
+ * Example: false
1076
+ */
1077
+ live_mode: boolean;
1078
+ /**
1079
+ * The ID of the hotel chain this negotiated rate is valid for.
1080
+ * Mutually exclusive with accommodation_ids.
1081
+ *
1082
+ * Example: "chn_0000B6QFxO9EOY5cqw5kYK"
1083
+ */
1084
+ chain_id: string | null;
1085
+ /**
1086
+ * The accommodation ids this negotiated rate is valid for use with.
1087
+ * Mutually exclusive with chain_id.
1088
+ *
1089
+ * Example: ["acc_0000AWr2VsUNIF1Vl91xg0"]
1090
+ */
1091
+ accommodation_ids: string[] | null;
1092
+ }
1093
+ /**
1094
+ * Payload for creating a negotiated rate associated with a chain.
1095
+ * You must provide either chain_id or accommodation_ids, but not both.
1096
+ */
1097
+ export interface StaysNegotiatedRateCreatePayloadWithChain {
1098
+ /**
1099
+ * The rate access code to be utilised when using this negotiated rate
1100
+ *
1101
+ * Example: "DUFFEL"
1102
+ */
1103
+ rate_access_code: string;
1104
+ /**
1105
+ * The display name of the negotiated rate
1106
+ *
1107
+ * Example: "2025 Negotiated Rate"
1108
+ */
1109
+ display_name: string;
1110
+ /**
1111
+ * The ID of the hotel chain this negotiated rate is valid for
1112
+ *
1113
+ * Example: "chn_0000B6QFxO9EOY5cqw5kYK"
1114
+ */
1115
+ chain_id: string;
1116
+ }
1117
+ /**
1118
+ * Payload for creating a negotiated rate associated with accommodations.
1119
+ * You must provide either chain_id or accommodation_ids, but not both.
1120
+ */
1121
+ export interface StaysNegotiatedRateCreatePayloadWithAccommodations {
1122
+ /**
1123
+ * The rate access code to be utilised when using this negotiated rate
1124
+ *
1125
+ * Example: "DUFFEL"
1126
+ */
1127
+ rate_access_code: string;
1128
+ /**
1129
+ * The display name of the negotiated rate
1130
+ *
1131
+ * Example: "2025 Negotiated Rate"
1132
+ */
1133
+ display_name: string;
1134
+ /**
1135
+ * The accommodation ids this negotiated rate is valid for use with
1136
+ *
1137
+ * Example: ["acc_0000AWr2VsUNIF1Vl91xg0"]
1138
+ */
1139
+ accommodation_ids: string[];
1140
+ }
1141
+ /**
1142
+ * Payload for creating a negotiated rate.
1143
+ * You must provide either chain_id or accommodation_ids, but not both.
1144
+ */
1145
+ export type StaysNegotiatedRateCreatePayload = StaysNegotiatedRateCreatePayloadWithChain | StaysNegotiatedRateCreatePayloadWithAccommodations;
1146
+ /**
1147
+ * Payload for updating a negotiated rate.
1148
+ * You can update the display_name and change the association to chain_id or accommodation_ids.
1149
+ * If updating the association, you must provide only one of chain_id or accommodation_ids.
1150
+ */
1151
+ export interface StaysNegotiatedRateUpdatePayload {
1152
+ /**
1153
+ * The display name of the negotiated rate
1154
+ *
1155
+ * Example: "2025 Negotiated Rate"
1156
+ */
1157
+ display_name?: string;
1158
+ /**
1159
+ * The ID of the hotel chain this negotiated rate is valid for.
1160
+ * Setting this will remove any existing accommodation_ids association.
1161
+ *
1162
+ * Example: "chn_0000B6QFxO9EOY5cqw5kYK"
1163
+ */
1164
+ chain_id?: string;
1165
+ /**
1166
+ * The accommodation ids this negotiated rate is valid for use with.
1167
+ * Setting this will remove any existing chain_id association.
1168
+ *
1169
+ * Example: ["acc_0000AWr2VsUNIF1Vl91xg0"]
1170
+ */
1171
+ accommodation_ids?: string[];
1172
+ }
1043
1173
  export {};
1044
1174
  }
1045
1175
 
@@ -1077,6 +1207,10 @@ declare module '@duffel/api/Stays/Bookings' {
1077
1207
  export * from '@duffel/api/Stays/Bookings/Bookings';
1078
1208
  }
1079
1209
 
1210
+ declare module '@duffel/api/Stays/NegotiatedRates' {
1211
+ export * from '@duffel/api/Stays/NegotiatedRates/NegotiatedRates';
1212
+ }
1213
+
1080
1214
  declare module '@duffel/api/Stays/Quotes' {
1081
1215
  export * from '@duffel/api/Stays/Quotes/Quotes';
1082
1216
  }
@@ -5772,6 +5906,51 @@ declare module '@duffel/api/Stays/Bookings/Bookings' {
5772
5906
  }
5773
5907
  }
5774
5908
 
5909
+ declare module '@duffel/api/Stays/NegotiatedRates/NegotiatedRates' {
5910
+ import { Client } from '@duffel/api/Client';
5911
+ import { StaysNegotiatedRate, StaysNegotiatedRateCreatePayload, StaysNegotiatedRateUpdatePayload } from '@duffel/api/Stays/StaysTypes';
5912
+ import { Resource } from '@duffel/api/Resource';
5913
+ import { DuffelResponse, PaginationMeta } from '@duffel/api/types';
5914
+ export class NegotiatedRates extends Resource {
5915
+ /**
5916
+ * Endpoint path
5917
+ */
5918
+ path: string;
5919
+ constructor(client: Client);
5920
+ /**
5921
+ * Create a negotiated rate.
5922
+ * You must provide either chain_id or accommodation_id, but not both.
5923
+ * @param {object} payload - The negotiated rate payload
5924
+ */
5925
+ create: (payload: StaysNegotiatedRateCreatePayload) => Promise<DuffelResponse<StaysNegotiatedRate>>;
5926
+ /**
5927
+ * Get a negotiated rate by ID
5928
+ * @param {string} id - The ID of the negotiated rate
5929
+ */
5930
+ get: (id: string) => Promise<DuffelResponse<StaysNegotiatedRate>>;
5931
+ /**
5932
+ * Update a negotiated rate
5933
+ * @param {string} id - The ID of the negotiated rate
5934
+ * @param {object} payload - The update payload
5935
+ */
5936
+ update: (id: string, payload: StaysNegotiatedRateUpdatePayload) => Promise<DuffelResponse<StaysNegotiatedRate>>;
5937
+ /**
5938
+ * List negotiated rates
5939
+ * @param {Object} [options] - Pagination options (optional: limit, after, before)
5940
+ */
5941
+ list: (options?: PaginationMeta) => Promise<DuffelResponse<StaysNegotiatedRate[]>>;
5942
+ /**
5943
+ * Retrieves a generator of all negotiated rates. The results may be returned in any order.
5944
+ */
5945
+ listWithGenerator: () => AsyncGenerator<DuffelResponse<StaysNegotiatedRate>, void, unknown>;
5946
+ /**
5947
+ * Delete a negotiated rate
5948
+ * @param {string} id - The ID of the negotiated rate
5949
+ */
5950
+ delete: (id: string) => Promise<DuffelResponse<StaysNegotiatedRate>>;
5951
+ }
5952
+ }
5953
+
5775
5954
  declare module '@duffel/api/Stays/Quotes/Quotes' {
5776
5955
  import { Client } from '@duffel/api/Client';
5777
5956
  import { StaysQuote } from '@duffel/api/Stays/StaysTypes';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duffel/api",
3
- "version": "4.25.0",
3
+ "version": "4.26.0",
4
4
  "description": "Javascript client library for the Duffel API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -50,23 +50,25 @@
50
50
  "set-value": "4.0.1",
51
51
  "minimist": "1.2.8",
52
52
  "semver": "7.5.3",
53
- "@aashutoshrathi/word-wrap": "npm:word-wrap"
53
+ "@aashutoshrathi/word-wrap": "npm:word-wrap",
54
+ "@semantic-release/npm": "13.1.5"
54
55
  },
55
56
  "dependencies": {
56
57
  "@types/node": "18.0.0",
57
- "@types/node-fetch": "2.6.2",
58
+ "@types/node-fetch": "2.6.13",
58
59
  "node-fetch": "2.7.0"
59
60
  },
60
61
  "devDependencies": {
61
- "@babel/core": "7.29.0",
62
- "@babel/preset-env": "7.29.2",
63
- "@babel/preset-typescript": "7.28.5",
62
+ "@babel/core": "7.29.7",
63
+ "@babel/preset-env": "7.29.7",
64
+ "@babel/preset-typescript": "7.29.7",
64
65
  "@commitlint/cli": "17.8.1",
65
66
  "@commitlint/config-angular": "17.8.1",
66
67
  "@rollup/plugin-commonjs": "25.0.8",
67
68
  "@rollup/plugin-node-resolve": "15.3.1",
68
69
  "@rollup/plugin-terser": "1.0.0",
69
70
  "@rollup/plugin-typescript": "12.3.0",
71
+ "@semantic-release/npm": "13.1.5",
70
72
  "@types/jest": "29.5.14",
71
73
  "@typescript-eslint/eslint-plugin": "6.7.5",
72
74
  "@typescript-eslint/parser": "6.7.5",
@@ -80,12 +82,12 @@
80
82
  "lint-staged": "15.5.2",
81
83
  "nock": "13.5.6",
82
84
  "prettier": "3.5.3",
83
- "rollup": "4.60.1",
85
+ "rollup": "4.61.1",
84
86
  "rollup-plugin-dts-bundle": "1.0.0",
85
87
  "rollup-plugin-inject-process-env": "1.3.1",
86
88
  "rollup-plugin-peer-deps-external": "2.2.4",
87
- "semantic-release": "22.0.12",
88
- "ts-jest": "29.4.6",
89
+ "semantic-release": "24.2.9",
90
+ "ts-jest": "29.4.11",
89
91
  "ts-node": "10.9.2",
90
92
  "tslib": "2.8.1",
91
93
  "typescript": "5.9.3"