mailmeteor 0.0.4 → 0.0.6

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/index.mjs CHANGED
@@ -951,7 +951,7 @@ class HeyApiRegistry5 {
951
951
  get(key) {
952
952
  const instance = this.instances.get(key ?? this.defaultKey);
953
953
  if (!instance) {
954
- throw new Error(`No SDK client found. Create one with "new BillingAddons2()" to fix this error.`);
954
+ throw new Error(`No SDK client found. Create one with "new Contacts2()" to fix this error.`);
955
955
  }
956
956
  return instance;
957
957
  }
@@ -967,7 +967,7 @@ class HeyApiRegistry6 {
967
967
  get(key) {
968
968
  const instance = this.instances.get(key ?? this.defaultKey);
969
969
  if (!instance) {
970
- throw new Error(`No SDK client found. Create one with "new BillingSubscription2()" to fix this error.`);
970
+ throw new Error(`No SDK client found. Create one with "new BillingAddons2()" to fix this error.`);
971
971
  }
972
972
  return instance;
973
973
  }
@@ -983,7 +983,7 @@ class HeyApiRegistry7 {
983
983
  get(key) {
984
984
  const instance = this.instances.get(key ?? this.defaultKey);
985
985
  if (!instance) {
986
- throw new Error(`No SDK client found. Create one with "new Billing2()" to fix this error.`);
986
+ throw new Error(`No SDK client found. Create one with "new BillingSubscription2()" to fix this error.`);
987
987
  }
988
988
  return instance;
989
989
  }
@@ -992,6 +992,22 @@ class HeyApiRegistry7 {
992
992
  }
993
993
  }
994
994
  class HeyApiRegistry8 {
995
+ constructor() {
996
+ this.defaultKey = 'default';
997
+ this.instances = new Map();
998
+ }
999
+ get(key) {
1000
+ const instance = this.instances.get(key ?? this.defaultKey);
1001
+ if (!instance) {
1002
+ throw new Error(`No SDK client found. Create one with "new Billing2()" to fix this error.`);
1003
+ }
1004
+ return instance;
1005
+ }
1006
+ set(value, key) {
1007
+ this.instances.set(key ?? this.defaultKey, value);
1008
+ }
1009
+ }
1010
+ class HeyApiRegistry9 {
995
1011
  constructor() {
996
1012
  this.defaultKey = 'default';
997
1013
  this.instances = new Map();
@@ -1263,6 +1279,164 @@ class ContactLists2 extends HeyApiClient {
1263
1279
  }
1264
1280
  }
1265
1281
  ContactLists2.__registry = new HeyApiRegistry4();
1282
+ class Contacts extends HeyApiClient {
1283
+ delAll(parameters, options) {
1284
+ const params = buildClientParams([parameters], [{ args: [{ in: 'body', key: 'owner' }, { in: 'body', key: 'contact_list' }] }]);
1285
+ return (options?.client ?? this.client).delete({
1286
+ responseStyle: 'data',
1287
+ url: '/contacts',
1288
+ ...options,
1289
+ ...params,
1290
+ headers: {
1291
+ 'Content-Type': 'application/json',
1292
+ ...options?.headers,
1293
+ ...params.headers
1294
+ }
1295
+ });
1296
+ }
1297
+ list(parameters, options) {
1298
+ const params = buildClientParams([parameters], [{ args: [
1299
+ { in: 'query', key: 'owner' },
1300
+ { in: 'query', key: 'limit' },
1301
+ { in: 'query', key: 'email' },
1302
+ { in: 'query', key: 'unsubscribed' },
1303
+ { in: 'query', key: 'contact_list' }
1304
+ ] }]);
1305
+ return (options?.client ?? this.client).get({
1306
+ responseStyle: 'data',
1307
+ url: '/contacts',
1308
+ ...options,
1309
+ ...params
1310
+ });
1311
+ }
1312
+ create(parameters, options) {
1313
+ const params = buildClientParams([parameters], [{ args: [
1314
+ { in: 'body', key: 'owner' },
1315
+ { in: 'body', key: 'email' },
1316
+ { in: 'body', key: 'blocked' },
1317
+ { in: 'body', key: 'unsubscribed' },
1318
+ { in: 'body', key: 'contact_lists' },
1319
+ { in: 'body', key: 'properties' },
1320
+ { in: 'body', key: 'notes' },
1321
+ { in: 'body', key: 'metadata' }
1322
+ ] }]);
1323
+ return (options?.client ?? this.client).post({
1324
+ responseStyle: 'data',
1325
+ url: '/contacts',
1326
+ ...options,
1327
+ ...params,
1328
+ headers: {
1329
+ 'Content-Type': 'application/json',
1330
+ ...options?.headers,
1331
+ ...params.headers
1332
+ }
1333
+ });
1334
+ }
1335
+ batchCreate(parameters, options) {
1336
+ const params = buildClientParams([parameters], [{ args: [{ in: 'body', key: 'contacts' }] }]);
1337
+ return (options?.client ?? this.client).post({
1338
+ responseStyle: 'data',
1339
+ url: '/contacts/batch',
1340
+ ...options,
1341
+ ...params,
1342
+ headers: {
1343
+ 'Content-Type': 'application/json',
1344
+ ...options?.headers,
1345
+ ...params.headers
1346
+ }
1347
+ });
1348
+ }
1349
+ batchCreate2(parameters, options) {
1350
+ const params = buildClientParams([parameters], [{ args: [{ key: 'body', map: 'body' }] }]);
1351
+ return (options?.client ?? this.client).post({
1352
+ responseStyle: 'data',
1353
+ url: '/contacts/batch_legacy',
1354
+ ...options,
1355
+ ...params,
1356
+ headers: {
1357
+ 'Content-Type': 'application/json',
1358
+ ...options?.headers,
1359
+ ...params.headers
1360
+ }
1361
+ });
1362
+ }
1363
+ del(contact_id, options) {
1364
+ const params = buildClientParams([contact_id], [{ in: 'path', key: 'contact_id' }]);
1365
+ return (options?.client ?? this.client).delete({
1366
+ responseStyle: 'data',
1367
+ url: '/contacts/{contact_id}',
1368
+ ...options,
1369
+ ...params
1370
+ });
1371
+ }
1372
+ retrieve(contact_id, options) {
1373
+ const params = buildClientParams([contact_id], [{ in: 'path', key: 'contact_id' }]);
1374
+ return (options?.client ?? this.client).get({
1375
+ responseStyle: 'data',
1376
+ url: '/contacts/{contact_id}',
1377
+ ...options,
1378
+ ...params
1379
+ });
1380
+ }
1381
+ update(contact_id, parameters, options) {
1382
+ const params = buildClientParams([contact_id, parameters], [{ in: 'path', key: 'contact_id' }, { args: [
1383
+ { in: 'body', key: 'blocked' },
1384
+ { in: 'body', key: 'unsubscribed' },
1385
+ { in: 'body', key: 'contact_lists' },
1386
+ { in: 'body', key: 'properties' },
1387
+ { in: 'body', key: 'notes' },
1388
+ { in: 'body', key: 'metadata' }
1389
+ ] }]);
1390
+ return (options?.client ?? this.client).patch({
1391
+ responseStyle: 'data',
1392
+ url: '/contacts/{contact_id}',
1393
+ ...options,
1394
+ ...params,
1395
+ headers: {
1396
+ 'Content-Type': 'application/json',
1397
+ ...options?.headers,
1398
+ ...params.headers
1399
+ }
1400
+ });
1401
+ }
1402
+ block(contact_id, options) {
1403
+ const params = buildClientParams([contact_id], [{ in: 'path', key: 'contact_id' }]);
1404
+ return (options?.client ?? this.client).post({
1405
+ responseStyle: 'data',
1406
+ url: '/contacts/{contact_id}/block',
1407
+ ...options,
1408
+ ...params
1409
+ });
1410
+ }
1411
+ unblock(contact_id, options) {
1412
+ const params = buildClientParams([contact_id], [{ in: 'path', key: 'contact_id' }]);
1413
+ return (options?.client ?? this.client).post({
1414
+ responseStyle: 'data',
1415
+ url: '/contacts/{contact_id}/unblock',
1416
+ ...options,
1417
+ ...params
1418
+ });
1419
+ }
1420
+ resubscribe(contact_id, options) {
1421
+ const params = buildClientParams([contact_id], [{ in: 'path', key: 'contact_id' }]);
1422
+ return (options?.client ?? this.client).post({
1423
+ responseStyle: 'data',
1424
+ url: '/contacts/{contact_id}/resubscribe',
1425
+ ...options,
1426
+ ...params
1427
+ });
1428
+ }
1429
+ }
1430
+ class Contacts2 extends HeyApiClient {
1431
+ constructor(args) {
1432
+ super(args);
1433
+ Contacts2.__registry.set(this, args?.key);
1434
+ }
1435
+ get contacts() {
1436
+ return this._contacts ?? (this._contacts = new Contacts({ client: this.client }));
1437
+ }
1438
+ }
1439
+ Contacts2.__registry = new HeyApiRegistry5();
1266
1440
  class BillingAddons extends HeyApiClient {
1267
1441
  getAddons(options) {
1268
1442
  return (options?.client ?? this.client).get({
@@ -1318,7 +1492,7 @@ class BillingAddons2 extends HeyApiClient {
1318
1492
  return this._billingAddons ?? (this._billingAddons = new BillingAddons({ client: this.client }));
1319
1493
  }
1320
1494
  }
1321
- BillingAddons2.__registry = new HeyApiRegistry5();
1495
+ BillingAddons2.__registry = new HeyApiRegistry6();
1322
1496
  class BillingSubscription extends HeyApiClient {
1323
1497
  get(options) {
1324
1498
  return (options?.client ?? this.client).get({
@@ -1365,7 +1539,7 @@ class BillingSubscription2 extends HeyApiClient {
1365
1539
  return this._billingSubscription ?? (this._billingSubscription = new BillingSubscription({ client: this.client }));
1366
1540
  }
1367
1541
  }
1368
- BillingSubscription2.__registry = new HeyApiRegistry6();
1542
+ BillingSubscription2.__registry = new HeyApiRegistry7();
1369
1543
  class Billing extends HeyApiClient {
1370
1544
  getPrices(parameters, options) {
1371
1545
  const params = buildClientParams([parameters], [{ args: [{ in: 'query', key: 'currency' }] }]);
@@ -1386,7 +1560,7 @@ class Billing2 extends HeyApiClient {
1386
1560
  return this._billing ?? (this._billing = new Billing({ client: this.client }));
1387
1561
  }
1388
1562
  }
1389
- Billing2.__registry = new HeyApiRegistry7();
1563
+ Billing2.__registry = new HeyApiRegistry8();
1390
1564
  class Default extends HeyApiClient {
1391
1565
  constructor(args) {
1392
1566
  super(args);
@@ -1400,7 +1574,7 @@ class Default extends HeyApiClient {
1400
1574
  });
1401
1575
  }
1402
1576
  }
1403
- Default.__registry = new HeyApiRegistry8();
1577
+ Default.__registry = new HeyApiRegistry9();
1404
1578
 
1405
1579
  var types_gen = /*#__PURE__*/Object.freeze({
1406
1580
  __proto__: null
@@ -1421,6 +1595,7 @@ class Mailmeteor {
1421
1595
  this.contactLists = new ContactLists({ client: this.client });
1422
1596
  this.organizations = new Organizations({ client: this.client });
1423
1597
  this.users = new Users({ client: this.client });
1598
+ this.contacts = new Contacts({ client: this.client });
1424
1599
  }
1425
1600
  setApiKey(key) {
1426
1601
  const currentConfig = this.client.getConfig();