@drawbridge/drawbridge-utils 0.0.173 → 0.0.174
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.
|
@@ -4953,8 +4953,10 @@ var shopify_default2 = {
|
|
|
4953
4953
|
} : null;
|
|
4954
4954
|
const source = (connection2 == null ? void 0 : connection2.source) ? { domain: connection2.source.domain, id: connection2.source.id } : void 0;
|
|
4955
4955
|
const createsOrder = !backfill && (isConversion || Boolean(discount));
|
|
4956
|
-
const
|
|
4957
|
-
const
|
|
4956
|
+
const mintedOrder = !(existingOrder == null ? void 0 : existingOrder.id) && createsOrder ? mintId() : null;
|
|
4957
|
+
const orderDocId = (existingOrder == null ? void 0 : existingOrder.id) || (mintedOrder == null ? void 0 : mintedOrder.id) || null;
|
|
4958
|
+
const mintedRedemption = discount ? mintId() : null;
|
|
4959
|
+
const redemptionDocId = (mintedRedemption == null ? void 0 : mintedRedemption.id) || null;
|
|
4958
4960
|
const writes = [];
|
|
4959
4961
|
if (createsOrder) {
|
|
4960
4962
|
writes.push({
|
|
@@ -4968,6 +4970,7 @@ var shopify_default2 = {
|
|
|
4968
4970
|
discount,
|
|
4969
4971
|
fee,
|
|
4970
4972
|
gross,
|
|
4973
|
+
_id: mintedOrder == null ? void 0 : mintedOrder._id,
|
|
4971
4974
|
id: orderDocId,
|
|
4972
4975
|
lead: leadId,
|
|
4973
4976
|
lines,
|
|
@@ -5027,6 +5030,7 @@ var shopify_default2 = {
|
|
|
5027
5030
|
customer,
|
|
5028
5031
|
discount,
|
|
5029
5032
|
gross,
|
|
5033
|
+
_id: mintedRedemption == null ? void 0 : mintedRedemption._id,
|
|
5030
5034
|
id: redemptionDocId,
|
|
5031
5035
|
lead: leadId,
|
|
5032
5036
|
order: orderDocId,
|
|
@@ -5147,7 +5151,8 @@ var shopify_default2 = {
|
|
|
5147
5151
|
"source.domain": connection2.shop
|
|
5148
5152
|
};
|
|
5149
5153
|
const existing = (read == null ? void 0 : read.get) ? await read.get({ collection: "product", query }) : null;
|
|
5150
|
-
const
|
|
5154
|
+
const mintedProduct = (existing == null ? void 0 : existing.id) ? null : mintId();
|
|
5155
|
+
const productId = (existing == null ? void 0 : existing.id) || mintedProduct.id;
|
|
5151
5156
|
return {
|
|
5152
5157
|
enqueues: [{
|
|
5153
5158
|
data: { product: productId, providerId, shop: connection2.shop },
|
|
@@ -5169,6 +5174,7 @@ var shopify_default2 = {
|
|
|
5169
5174
|
data: {
|
|
5170
5175
|
$addToSet: { connections: connection2.id },
|
|
5171
5176
|
$setOnInsert: {
|
|
5177
|
+
...mintedProduct && { _id: mintedProduct._id },
|
|
5172
5178
|
id: productId,
|
|
5173
5179
|
provider: { id: providerId, slug: "shopify" },
|
|
5174
5180
|
"source.id": connection2.id,
|
|
@@ -6312,8 +6312,17 @@ var shopify = {
|
|
|
6312
6312
|
// job names both — a description cannot read a write's result, so the
|
|
6313
6313
|
// id exists before either does. Minted for the redemption too, so the
|
|
6314
6314
|
// order can name it back.
|
|
6315
|
-
|
|
6316
|
-
|
|
6315
|
+
// MINTED AS A PAIR. `mintId` hands back both halves — the driver's `_id` and
|
|
6316
|
+
// its string `id` — because this package has no mongodb dependency and
|
|
6317
|
+
// cannot construct one. The string is what every reference below uses; the
|
|
6318
|
+
// `_id` goes on the create so the document is born with the pair the
|
|
6319
|
+
// controller would otherwise derive.
|
|
6320
|
+
const mintedOrder = ! existingOrder?.id && createsOrder ? mintId() : null;
|
|
6321
|
+
|
|
6322
|
+
const orderDocId = existingOrder?.id || mintedOrder?.id || null;
|
|
6323
|
+
const mintedRedemption = discount ? mintId() : null;
|
|
6324
|
+
|
|
6325
|
+
const redemptionDocId = mintedRedemption?.id || null;
|
|
6317
6326
|
|
|
6318
6327
|
const writes = [];
|
|
6319
6328
|
|
|
@@ -6330,6 +6339,7 @@ var shopify = {
|
|
|
6330
6339
|
discount,
|
|
6331
6340
|
fee,
|
|
6332
6341
|
gross,
|
|
6342
|
+
_id : mintedOrder?._id,
|
|
6333
6343
|
id : orderDocId,
|
|
6334
6344
|
lead : leadId,
|
|
6335
6345
|
lines,
|
|
@@ -6402,6 +6412,7 @@ var shopify = {
|
|
|
6402
6412
|
customer,
|
|
6403
6413
|
discount,
|
|
6404
6414
|
gross,
|
|
6415
|
+
_id : mintedRedemption?._id,
|
|
6405
6416
|
id : redemptionDocId,
|
|
6406
6417
|
lead : leadId,
|
|
6407
6418
|
order : orderDocId,
|
|
@@ -6600,7 +6611,9 @@ var shopify = {
|
|
|
6600
6611
|
|
|
6601
6612
|
const existing = read?.get ? await read.get({ collection : 'product', query }) : null;
|
|
6602
6613
|
|
|
6603
|
-
const
|
|
6614
|
+
const mintedProduct = existing?.id ? null : mintId();
|
|
6615
|
+
|
|
6616
|
+
const productId = existing?.id || mintedProduct.id;
|
|
6604
6617
|
|
|
6605
6618
|
return {
|
|
6606
6619
|
enqueues : [ {
|
|
@@ -6623,6 +6636,7 @@ var shopify = {
|
|
|
6623
6636
|
data : {
|
|
6624
6637
|
$addToSet : { connections : connection.id },
|
|
6625
6638
|
$setOnInsert : {
|
|
6639
|
+
...( mintedProduct && { _id : mintedProduct._id }),
|
|
6626
6640
|
id : productId,
|
|
6627
6641
|
provider : { id : providerId, slug : 'shopify' },
|
|
6628
6642
|
'source.id' : connection.id,
|
|
@@ -6312,8 +6312,17 @@ var shopify = {
|
|
|
6312
6312
|
// job names both — a description cannot read a write's result, so the
|
|
6313
6313
|
// id exists before either does. Minted for the redemption too, so the
|
|
6314
6314
|
// order can name it back.
|
|
6315
|
-
|
|
6316
|
-
|
|
6315
|
+
// MINTED AS A PAIR. `mintId` hands back both halves — the driver's `_id` and
|
|
6316
|
+
// its string `id` — because this package has no mongodb dependency and
|
|
6317
|
+
// cannot construct one. The string is what every reference below uses; the
|
|
6318
|
+
// `_id` goes on the create so the document is born with the pair the
|
|
6319
|
+
// controller would otherwise derive.
|
|
6320
|
+
const mintedOrder = ! existingOrder?.id && createsOrder ? mintId() : null;
|
|
6321
|
+
|
|
6322
|
+
const orderDocId = existingOrder?.id || mintedOrder?.id || null;
|
|
6323
|
+
const mintedRedemption = discount ? mintId() : null;
|
|
6324
|
+
|
|
6325
|
+
const redemptionDocId = mintedRedemption?.id || null;
|
|
6317
6326
|
|
|
6318
6327
|
const writes = [];
|
|
6319
6328
|
|
|
@@ -6330,6 +6339,7 @@ var shopify = {
|
|
|
6330
6339
|
discount,
|
|
6331
6340
|
fee,
|
|
6332
6341
|
gross,
|
|
6342
|
+
_id : mintedOrder?._id,
|
|
6333
6343
|
id : orderDocId,
|
|
6334
6344
|
lead : leadId,
|
|
6335
6345
|
lines,
|
|
@@ -6402,6 +6412,7 @@ var shopify = {
|
|
|
6402
6412
|
customer,
|
|
6403
6413
|
discount,
|
|
6404
6414
|
gross,
|
|
6415
|
+
_id : mintedRedemption?._id,
|
|
6405
6416
|
id : redemptionDocId,
|
|
6406
6417
|
lead : leadId,
|
|
6407
6418
|
order : orderDocId,
|
|
@@ -6600,7 +6611,9 @@ var shopify = {
|
|
|
6600
6611
|
|
|
6601
6612
|
const existing = read?.get ? await read.get({ collection : 'product', query }) : null;
|
|
6602
6613
|
|
|
6603
|
-
const
|
|
6614
|
+
const mintedProduct = existing?.id ? null : mintId();
|
|
6615
|
+
|
|
6616
|
+
const productId = existing?.id || mintedProduct.id;
|
|
6604
6617
|
|
|
6605
6618
|
return {
|
|
6606
6619
|
enqueues : [ {
|
|
@@ -6623,6 +6636,7 @@ var shopify = {
|
|
|
6623
6636
|
data : {
|
|
6624
6637
|
$addToSet : { connections : connection.id },
|
|
6625
6638
|
$setOnInsert : {
|
|
6639
|
+
...( mintedProduct && { _id : mintedProduct._id }),
|
|
6626
6640
|
id : productId,
|
|
6627
6641
|
provider : { id : providerId, slug : 'shopify' },
|
|
6628
6642
|
'source.id' : connection.id,
|
|
@@ -4877,8 +4877,10 @@ var shopify_default2 = {
|
|
|
4877
4877
|
} : null;
|
|
4878
4878
|
const source = (connection2 == null ? void 0 : connection2.source) ? { domain: connection2.source.domain, id: connection2.source.id } : void 0;
|
|
4879
4879
|
const createsOrder = !backfill && (isConversion || Boolean(discount));
|
|
4880
|
-
const
|
|
4881
|
-
const
|
|
4880
|
+
const mintedOrder = !(existingOrder == null ? void 0 : existingOrder.id) && createsOrder ? mintId() : null;
|
|
4881
|
+
const orderDocId = (existingOrder == null ? void 0 : existingOrder.id) || (mintedOrder == null ? void 0 : mintedOrder.id) || null;
|
|
4882
|
+
const mintedRedemption = discount ? mintId() : null;
|
|
4883
|
+
const redemptionDocId = (mintedRedemption == null ? void 0 : mintedRedemption.id) || null;
|
|
4882
4884
|
const writes = [];
|
|
4883
4885
|
if (createsOrder) {
|
|
4884
4886
|
writes.push({
|
|
@@ -4892,6 +4894,7 @@ var shopify_default2 = {
|
|
|
4892
4894
|
discount,
|
|
4893
4895
|
fee,
|
|
4894
4896
|
gross,
|
|
4897
|
+
_id: mintedOrder == null ? void 0 : mintedOrder._id,
|
|
4895
4898
|
id: orderDocId,
|
|
4896
4899
|
lead: leadId,
|
|
4897
4900
|
lines,
|
|
@@ -4951,6 +4954,7 @@ var shopify_default2 = {
|
|
|
4951
4954
|
customer,
|
|
4952
4955
|
discount,
|
|
4953
4956
|
gross,
|
|
4957
|
+
_id: mintedRedemption == null ? void 0 : mintedRedemption._id,
|
|
4954
4958
|
id: redemptionDocId,
|
|
4955
4959
|
lead: leadId,
|
|
4956
4960
|
order: orderDocId,
|
|
@@ -5071,7 +5075,8 @@ var shopify_default2 = {
|
|
|
5071
5075
|
"source.domain": connection2.shop
|
|
5072
5076
|
};
|
|
5073
5077
|
const existing = (read == null ? void 0 : read.get) ? await read.get({ collection: "product", query }) : null;
|
|
5074
|
-
const
|
|
5078
|
+
const mintedProduct = (existing == null ? void 0 : existing.id) ? null : mintId();
|
|
5079
|
+
const productId = (existing == null ? void 0 : existing.id) || mintedProduct.id;
|
|
5075
5080
|
return {
|
|
5076
5081
|
enqueues: [{
|
|
5077
5082
|
data: { product: productId, providerId, shop: connection2.shop },
|
|
@@ -5093,6 +5098,7 @@ var shopify_default2 = {
|
|
|
5093
5098
|
data: {
|
|
5094
5099
|
$addToSet: { connections: connection2.id },
|
|
5095
5100
|
$setOnInsert: {
|
|
5101
|
+
...mintedProduct && { _id: mintedProduct._id },
|
|
5096
5102
|
id: productId,
|
|
5097
5103
|
provider: { id: providerId, slug: "shopify" },
|
|
5098
5104
|
"source.id": connection2.id,
|
package/dist/providers.cjs
CHANGED
|
@@ -4881,8 +4881,10 @@ var shopify_default2 = {
|
|
|
4881
4881
|
} : null;
|
|
4882
4882
|
const source = (connection2 == null ? void 0 : connection2.source) ? { domain: connection2.source.domain, id: connection2.source.id } : void 0;
|
|
4883
4883
|
const createsOrder = !backfill && (isConversion || Boolean(discount));
|
|
4884
|
-
const
|
|
4885
|
-
const
|
|
4884
|
+
const mintedOrder = !(existingOrder == null ? void 0 : existingOrder.id) && createsOrder ? mintId() : null;
|
|
4885
|
+
const orderDocId = (existingOrder == null ? void 0 : existingOrder.id) || (mintedOrder == null ? void 0 : mintedOrder.id) || null;
|
|
4886
|
+
const mintedRedemption = discount ? mintId() : null;
|
|
4887
|
+
const redemptionDocId = (mintedRedemption == null ? void 0 : mintedRedemption.id) || null;
|
|
4886
4888
|
const writes = [];
|
|
4887
4889
|
if (createsOrder) {
|
|
4888
4890
|
writes.push({
|
|
@@ -4896,6 +4898,7 @@ var shopify_default2 = {
|
|
|
4896
4898
|
discount,
|
|
4897
4899
|
fee,
|
|
4898
4900
|
gross,
|
|
4901
|
+
_id: mintedOrder == null ? void 0 : mintedOrder._id,
|
|
4899
4902
|
id: orderDocId,
|
|
4900
4903
|
lead: leadId,
|
|
4901
4904
|
lines,
|
|
@@ -4955,6 +4958,7 @@ var shopify_default2 = {
|
|
|
4955
4958
|
customer,
|
|
4956
4959
|
discount,
|
|
4957
4960
|
gross,
|
|
4961
|
+
_id: mintedRedemption == null ? void 0 : mintedRedemption._id,
|
|
4958
4962
|
id: redemptionDocId,
|
|
4959
4963
|
lead: leadId,
|
|
4960
4964
|
order: orderDocId,
|
|
@@ -5075,7 +5079,8 @@ var shopify_default2 = {
|
|
|
5075
5079
|
"source.domain": connection2.shop
|
|
5076
5080
|
};
|
|
5077
5081
|
const existing = (read == null ? void 0 : read.get) ? await read.get({ collection: "product", query }) : null;
|
|
5078
|
-
const
|
|
5082
|
+
const mintedProduct = (existing == null ? void 0 : existing.id) ? null : mintId();
|
|
5083
|
+
const productId = (existing == null ? void 0 : existing.id) || mintedProduct.id;
|
|
5079
5084
|
return {
|
|
5080
5085
|
enqueues: [{
|
|
5081
5086
|
data: { product: productId, providerId, shop: connection2.shop },
|
|
@@ -5097,6 +5102,7 @@ var shopify_default2 = {
|
|
|
5097
5102
|
data: {
|
|
5098
5103
|
$addToSet: { connections: connection2.id },
|
|
5099
5104
|
$setOnInsert: {
|
|
5105
|
+
...mintedProduct && { _id: mintedProduct._id },
|
|
5100
5106
|
id: productId,
|
|
5101
5107
|
provider: { id: providerId, slug: "shopify" },
|
|
5102
5108
|
"source.id": connection2.id,
|
package/dist/providers.js
CHANGED
|
@@ -4832,8 +4832,10 @@ var shopify_default2 = {
|
|
|
4832
4832
|
} : null;
|
|
4833
4833
|
const source = (connection2 == null ? void 0 : connection2.source) ? { domain: connection2.source.domain, id: connection2.source.id } : void 0;
|
|
4834
4834
|
const createsOrder = !backfill && (isConversion || Boolean(discount));
|
|
4835
|
-
const
|
|
4836
|
-
const
|
|
4835
|
+
const mintedOrder = !(existingOrder == null ? void 0 : existingOrder.id) && createsOrder ? mintId() : null;
|
|
4836
|
+
const orderDocId = (existingOrder == null ? void 0 : existingOrder.id) || (mintedOrder == null ? void 0 : mintedOrder.id) || null;
|
|
4837
|
+
const mintedRedemption = discount ? mintId() : null;
|
|
4838
|
+
const redemptionDocId = (mintedRedemption == null ? void 0 : mintedRedemption.id) || null;
|
|
4837
4839
|
const writes = [];
|
|
4838
4840
|
if (createsOrder) {
|
|
4839
4841
|
writes.push({
|
|
@@ -4847,6 +4849,7 @@ var shopify_default2 = {
|
|
|
4847
4849
|
discount,
|
|
4848
4850
|
fee,
|
|
4849
4851
|
gross,
|
|
4852
|
+
_id: mintedOrder == null ? void 0 : mintedOrder._id,
|
|
4850
4853
|
id: orderDocId,
|
|
4851
4854
|
lead: leadId,
|
|
4852
4855
|
lines,
|
|
@@ -4906,6 +4909,7 @@ var shopify_default2 = {
|
|
|
4906
4909
|
customer,
|
|
4907
4910
|
discount,
|
|
4908
4911
|
gross,
|
|
4912
|
+
_id: mintedRedemption == null ? void 0 : mintedRedemption._id,
|
|
4909
4913
|
id: redemptionDocId,
|
|
4910
4914
|
lead: leadId,
|
|
4911
4915
|
order: orderDocId,
|
|
@@ -5026,7 +5030,8 @@ var shopify_default2 = {
|
|
|
5026
5030
|
"source.domain": connection2.shop
|
|
5027
5031
|
};
|
|
5028
5032
|
const existing = (read == null ? void 0 : read.get) ? await read.get({ collection: "product", query }) : null;
|
|
5029
|
-
const
|
|
5033
|
+
const mintedProduct = (existing == null ? void 0 : existing.id) ? null : mintId();
|
|
5034
|
+
const productId = (existing == null ? void 0 : existing.id) || mintedProduct.id;
|
|
5030
5035
|
return {
|
|
5031
5036
|
enqueues: [{
|
|
5032
5037
|
data: { product: productId, providerId, shop: connection2.shop },
|
|
@@ -5048,6 +5053,7 @@ var shopify_default2 = {
|
|
|
5048
5053
|
data: {
|
|
5049
5054
|
$addToSet: { connections: connection2.id },
|
|
5050
5055
|
$setOnInsert: {
|
|
5056
|
+
...mintedProduct && { _id: mintedProduct._id },
|
|
5051
5057
|
id: productId,
|
|
5052
5058
|
provider: { id: providerId, slug: "shopify" },
|
|
5053
5059
|
"source.id": connection2.id,
|
package/package.json
CHANGED