← back to Flock Fix Viewer

__pycache__/apply-flock-combine.cpython-314.pyc

62 lines

+
Y��jj���Rt^RIt^RIt^RIt^RIt^RIt^RItRR�RR�RR�/tRt	Rt
]!]P4^8�d]P^,MRP4tR]P9t]]9d]!R	4]P"!^4]],wtt]!]P*P-R
44P/4t]!R]P544R4tRtR
]R2tR�RltR�Rlt]!RR]R24R,t ]!RR]R24R,t!] R,Uu.uF7qPER4;'gRPG4R]28XgK5VNK9	up^,t$]!R,Uu.uF5pRVPER4;'gRPK49gK3VNK7	up^,t&]$PER4;'gRt']$PER4;'gRt(])!]*PW] R,PYR4Uu.uF*qP4'gKVP4NK,	up44t-]-Uu.uFqPK4R�9gKVNK	upt-R]-9d]-P]R4]!R ]R!]R"]R#]24]!R$4]!R%]24]!R&]$R,R'](R(]&R,R)24]!R*]!] PER+4;'gR4R,]!]-4R-24]!R.4]'g]!R/4]P"!^4]P^!]P*P-R04R1R27]!]P*P-R3]R424R54Pa]Pb!]!^R674RR7]R8R9R:R;]2R+] PER+4;'g]!PER+4RR<Pe]-4R=R>R?/.RR]'RR]2R]3!](4R@RARBRCRD^RERFRG^/R7]&R7,RRHRR]RI2RRJR@RKRBRCRG^/.//t4]!RL4]!RMR]R2]44R,t5]5R,Uu/uFqR,VbK	upt6]6R]2,t7]6R]RI2,t8]!RN]5R,Uu.uF1qR,VR,VR,RO]3!VRG,4,3NK3	up4]!RP4]7RQ3]8RR33F2wt9t:]!RSRTRU]	RV]9RV,RW]:/4]!RX]9R,RY]:24K4	]!RZ4^t;]!RR]R[24R\,FZt<]<R],]<R^,3R�8XdK]!RSR]R[2R_R]]<R],R^]<R^,R`]<R`,Ra]<Ra,//4];^,
t;K\	]!RR]R[24R\,F;t<]<R],]<R^,3R�8XgK]!RbR]Rc]<R7,R24]!Rd4K=	]!Re];Rf24]!Rg4]!Rh]
,4t>]>Ri,R,Rj,Rk,Uu.uF*q"Rl,Rm,'gKVRl,Rn,NK,	upt?]!RoR7Rp]2Rq]?Uu.uFpRrVR7,/NK	up/4t@]!Rs]?Uu.uFq3R>,NK
	upRt]@PERi/4PERu/4PERv.4;'gRw4]!]P*P-Rx4Ry4Pa]Pb!Rz]P�!R{]P�!44R|R}R~RR�R�]R�]R�]R�2R�^R�R�]R�]7R7,2R�R�]R2/4R�,4]!RR]R�24R,tC]!R�]CR7,R�]CR�,R�]CR8,R�]CR:,24]CR,F6t9]!RX]9R,R�
R�]9R,R�
R']9R,R�
R�]9R@,24K8	]!R�]R�24R#uupiuupiuupiuupiuupiuupi ]=dEK�i;iuupiuupiuupi)�u�
TK-11122 — flock split-brain fix. Rebuild the ACTIVE (thin sample) survivor into
ONE combined roll+sample wallcovering SKU by copying the roll variant + metafields
forward from its ARCHIVED rich twin. Archived twin is LEFT ARCHIVED (Steve: "if it
was archived, leave it. We need 1 sku with roll and sample").

Usage:  python3 apply-flock-combine.py 1046 [--apply]
        (no --apply = dry run: prints exactly what it will change, writes nothing)

Reversible: survivor pre-state snapshot saved; ledgered.
N�1045�1046�1047lp�2l3K&��z--applyz8usage: apply-flock-combine.py <1045|1046|1047> [--apply]z~/Projects/secrets-manager/.envc#��"�TFTpVPR4'gKVPR^4^,P4PR4x�KV	R#5i)zSHOPIFY_FULL_ACCESS_TOKEN=�=z"'N)�
startswith�split�strip)�.0�ls& �B/Users/macstudio3/Projects/flock-fix-viewer/apply-flock-combine.py�	<genexpr>rsL���;�<L�q��|�|�8�9�
3�A�G�G�C��N�1��#�#�%�+�+�E�2�2�<L�s
�A�>Az)designer-laboratory-sandbox.myshopify.comzhttps://z/admin/api/2024-10c	���Ve%\P!V4P4MRp\PP\RV2W0R\RR/R7p\P!\PPV44# \PPdAp\RTPTP4P4R,4hRp?ii;i)N�/�X-Shopify-Access-Token�Content-Type�application/json)�data�method�headersz  HTTP:Ni�N)�json�dumps�encode�urllib�request�Request�API�TOKEN�load�urlopen�error�	HTTPError�print�code�read�decode)r�path�bodyr�req�es&&&   r
�callr+#s���&*�&6����D�	�	 �	 �	"�D�D������#��a��v��D�)�%��?Q�R�	�	T�C��	�	�&�.�.�0�0��5�6�	6���<�<�!�!�>�
�h�q�v�v�a�f�f�h�o�o�/��5�6���>�s�2B�C0�0;C+�+C0c
�*�\PP\R2\P
!RTRT;'g//4P
4R\RR/R7p\P!\PPV44#)z
/graphql.json�query�	variablesrrr)rr)
rrrrrrrrrr )�q�vr)s&& r
�gqlr1*sx�������#��m�4�$�*�*�g�a�P[�\]�\c�\c�ac�Ed�:e�:l�:l�:n�)�%��?Q�R�	�	T�C��9�9�V�^�^�+�+�C�0�1�1��GETz	products/z.json�product�variants�skuzFLOCK-�sample�option1z(Sold per single roll (20.5" x 5.5 yards)�pricez190.99�tags�,zPhillipe Romanoz
=== flock z  SRC(archived rich)=z  DST(active survivor)=z  APPLY=zI  will set DST title -> 'Sadie's Retro Block Flocked Velvet Wallcovering'z.  handle -> sadies-retro-block-flocked-velvet-z  variants -> [ROLL z $z continue pos1] + [SAMPLE z $4.25 deny pos2]z  body_html <- archived roll (�	body_htmlz chars);  tags(z") drop display-exclude/Memo Samplezt  copy metafields <- archived roll (skip custom.has_sample); delete stale custom.sample_of; publish to 1044 channelsu=
DRY RUN — nothing written. Re-run with --apply to execute.z+~/Projects/flock-fix-viewer/sadie-snapshotsT)�exist_okz,~/Projects/flock-fix-viewer/sadie-snapshots/z-survivor-pre.json�w)�indent�id�titlez/Sadie's Retro Block Flocked Velvet Wallcovering�handlez"sadies-retro-block-flocked-velvet-z, �options�name�Size�inventory_policy�continue�inventory_management�shopify�weight�weight_unit�lb�position�Samplez-samplez4.25�denyu
[A] PUT product update…�PUTz   variants:�posu[B] inventory set…i�i��POSTzinventory_levels/set.json�location_id�inventory_item_id�	availablez   z -> u[C] copy metafields…z/metafields.json�
metafields�	namespace�key�	metafield�type�value�DELETEz/metafields/z!   deleted stale custom.sample_ofz
   copied z metafieldsu[D] publish to channels…z{{ product(id:"gid://shopify/Product/%d"){ resourcePublicationsV2(first:20){edges{node{publication{id name} isPublished}}}}}r�resourcePublicationsV2�edges�node�isPublished�publicationzkmutation($id:ID!,$in:[PublicationInput!]!){publishablePublish(id:$id,input:$in){userErrors{field message}}}zgid://shopify/Product/�in�
publicationIdz   ->z	| errors:�publishablePublish�
userErrors�nonez5~/.claude/yolo-queue/executed-reversible/ledger.jsonl�a�tsz%Y-%m-%dT%H:%M:%SZ�agentzvp-dw-commerce�ticketzTK-11122�actionzflock z: rebuilt survivor z5 -> combined roll+sample wallcovering; archived twin z left archived�blast_radius�undo_cmdz4restore ~/Projects/flock-fix-viewer/sadie-snapshots/z(-survivor-pre.json; delete roll variant �verifyz
GET products/�
z,.json?fields=id,title,status,handle,variantsz

[VERIFY] � �statusz 'z' /�20�40z>7zDONE flock �.)l3Q&�l3�y�)l3e&�l3Qy�)l3o&�l3by�)N)zdisplay-excludezmemo sample)�custom�
has_sample)ru�	sample_of)D�__doc__�os�sysr�time�urllib.requestr�urllib.error�MAP�LOC�TMPL�len�argvr
�cw�APPLYr#�exit�SRC�DST�openr'�
expanduserr%�env�next�
splitlinesr�STORErr+r1�src�dst�get�upper�roll_v�lower�samp_v�roll_opt�
roll_price�list�dict�fromkeysr	r:�append�makedirs�writer�join�str�payload�res�vs�roll�sampr0�qty�copied�m�	Exception�tmpl�pubs�r�strftime�gmtime�fin)r0�tr*�ps0000r
�<module>r�sq	��
�4�3�3��%��%��%���
�����s�x�x�=��?�C�H�H�Q�K��1�1�3���3�8�8����S�=�	�
D�E�s�x�x�PQ�{��B����C�����	�	�=�	>�?�D�D�F��
�;�C�N�N�<L�;�;?�A��1���u�g�'�(��>�2�
	���3�%�u�%�&�y�1�����3�%�u�%�&�y�1���z�?�R�?�a�u�u�U�|�'9�'9�r�&@�&@�&B�f�R�D�M�&Q���?�R�ST�U���z�?�O�?�a�h�1�5�5��<�3E�3E�2�2L�2L�2N�&N���?�O�PQ�R��	���I�	�	L�	L�"L���:�:�g��*�*�(�
�	�$�-�-�C��K�,=�,=�c�,B�P�,B�q�g�g�i������,B�P�
Q�R���L��A����*K�K�a�a��L���D� �$�+�+�.?�"@��
�2�$�+�C�5�0G��u�H�UZ�T[�\�]��Q�S��6�r�d�;�<���V�E�]�O�2�j�\�9S�TZ�[`�Ta�Sb�bs�t�u��&�s�3�7�7�;�+?�+E�+E�2�'F�&G��WZ�[_�W`�Va�bD�E�F��|�~��	�
J�K�S�X�X�VW�[����B�G�G���L�M�W[�\��R�W�W���F�r�d�J\�]�^�_b�c�i�i�jn�jt�jt�ux�AB�kC�D�
�D��	�
;�
�
/��t�4�
�c�g�g�k�"�:�:�c�g�g�k�&:�����4���f�V�_��������t�}�W�S��_���$:�9�X�a�P]�^b�cm�no�q�
�6�$�<�	�(�5�6�"��W�1E�g�f��� 6�y��A�O��
�	���#�$����3�%�u�%�g�.�y�9���J��(��1�e�H�Q�J��(���&���
���R�&���G� 4�5���n�[^�_i�[j�k�[j�VW��x��)��Q�w�Z��c�!�J�-�>P�8P�Q�[j�k�l�����D�k�4��+�
&�E�A�c���+�]�3�?R�ST�Uh�Si�ju�vy�,z�{�	�C��%��z��c�U�
#�$�'�
�����	
�e�i��u�$4�5�	6�|�	D�	D�A�	�+��q��x� �"9�9�8���V�i��u�$4�5�{�K�PQ�R]�P^�_d�ef�gl�em�nt�uv�w}�u~�@G�HI�JQ�HR�DS�7T�	U�W]�_`�W`�W]�
E�

�e�i��u�$4�5�	6�|�	D�	D�A�	�+��q��x� �"8�8��X�	�#��l�1�T�7�)�5�A�B�E�Jm�Dn�
E��
�6�(�+�&�'��"�#��
G�HL�
L�M��(,�V��Y�(?�@X�(Y�Za�(b��(b�1�hn�fo�p}�f~�f~��a��i�
���(b����s��$�S�E�*�4�TX�0Y�TX�q�/�!�D�'�1J�TX�0Y�Z�\���g�$�'�$�Q��y�y�$�'��A�E�E�&��4D�4H�4H�I]�^`�4a�4e�4e�fr�su�4v�5A�5A�{A�B��R�W�W���O�P�QT�U�[�[�\`�\f�\f��t�}�}�)�$�+�+�-�8��AQ�RZ�[e�
�V�B�4�*�3�%�/d�eh�di�iw�x���:� T�UW�TX�YA�BF�GK�BL�AM�N�
�]�3�%�u�%�	h'�](�)-�	]-�.�	���3�%�K�L�M�i�X����C��I�;�a��H�
��b��W���c�#�h�-��Q�R�	�Z���A�	�C��%���}�A�a�	�l�2�.�b��7��B��q��CU�AV�@W�
X�Y�
���B�4�q����_S��O��Q��L��<)��k����d���@��0Y��'sr�/`�`�&`�`�`�6`�#`�?`�"` �=` �"`%�7`*
�=`/�4`>�`>�4a�a
�/`;�:`;